os/debian
This commit is contained in:
parent
4e369df232
commit
909e652f0d
2 changed files with 32 additions and 2 deletions
|
@ -2,10 +2,23 @@
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from rwx.err import Error
|
||||||
|
from rwx.os.debian import Debian
|
||||||
|
|
||||||
|
|
||||||
class OS:
|
class OS:
|
||||||
"""Operating System."""
|
"""Operating System."""
|
||||||
|
|
||||||
def __init__(self, path: str) -> None:
|
def __init__(self, path: Path) -> None:
|
||||||
"""Set root."""
|
"""Set root."""
|
||||||
self.root = Path(path)
|
self.root = path
|
||||||
|
self.name = self.get_name()
|
||||||
|
|
||||||
|
def get_name(self) -> str:
|
||||||
|
"""Return mandatory name."""
|
||||||
|
raise Error
|
||||||
|
|
||||||
|
|
||||||
|
def from_path(path: Path) -> OS:
|
||||||
|
"""Initialize from an already existing path."""
|
||||||
|
return Debian(path)
|
||||||
|
|
17
rwx/os/debian.py
Normal file
17
rwx/os/debian.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
"""Debian operating system."""
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from . import OS
|
||||||
|
|
||||||
|
|
||||||
|
class Debian(OS):
|
||||||
|
"""Debian operating system."""
|
||||||
|
|
||||||
|
def __init__(self, path: Path) -> None:
|
||||||
|
"""Initialize."""
|
||||||
|
super().__init__(path)
|
||||||
|
|
||||||
|
def get_name(self) -> str:
|
||||||
|
"""Return name."""
|
||||||
|
return "Debian"
|
Loading…
Reference in a new issue