os/debian

This commit is contained in:
Marc Beninca 2024-09-14 15:23:06 +02:00
parent 4e369df232
commit 909e652f0d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 32 additions and 2 deletions

View file

@ -2,10 +2,23 @@
from pathlib import Path
from rwx.err import Error
from rwx.os.debian import Debian
class OS:
"""Operating System."""
def __init__(self, path: str) -> None:
def __init__(self, path: Path) -> None:
"""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
View 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"