abc
This commit is contained in:
parent
9c1136cfa0
commit
e75a624c46
1 changed files with 3 additions and 3 deletions
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from rwx.err import Error
|
|
||||||
from rwx.os.debian import Debian
|
from rwx.os.debian import Debian
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class OS:
|
class OS(ABC):
|
||||||
"""Operating System."""
|
"""Operating System."""
|
||||||
|
|
||||||
def __init__(self, path: Path) -> None:
|
def __init__(self, path: Path) -> None:
|
||||||
|
@ -19,9 +19,9 @@ class OS:
|
||||||
self.root = path
|
self.root = path
|
||||||
self.name = self.get_name()
|
self.name = self.get_name()
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
def get_name(self) -> str:
|
def get_name(self) -> str:
|
||||||
"""Return mandatory name."""
|
"""Return mandatory name."""
|
||||||
raise Error
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_path(path: Path) -> OS:
|
def from_path(path: Path) -> OS:
|
||||||
|
|
Loading…
Reference in a new issue