diff --git a/rwx/os/pm/__init__.py b/rwx/os/pm/__init__.py new file mode 100644 index 0000000..0bcf1e6 --- /dev/null +++ b/rwx/os/pm/__init__.py @@ -0,0 +1,17 @@ +"""Package Manager.""" + +from abc import ABC, abstractmethod + +from rwx.ps import Command + + +class PM(ABC): + """Package Manager.""" + + def __init__(self) -> None: + """Set commands.""" + self.install = self.get_install_command() + + @abstractmethod + def get_install_command(self) -> Command: + """Command to install package(s).""" diff --git a/rwx/os/pm/apt.py b/rwx/os/pm/apt.py new file mode 100644 index 0000000..17caac3 --- /dev/null +++ b/rwx/os/pm/apt.py @@ -0,0 +1,16 @@ +"""Advanced Package Tool.""" + +from rwx.os.pm import PM +from rwx.ps import Command + + +class APT(PM): + """Advanced Package Tool.""" + + def __init__(self) -> None: + """Initialize.""" + super().__init__() + + def get_install_command(self) -> Command: + """Return install command.""" + return Command() diff --git a/rwx/ps/__init__.py b/rwx/ps/__init__.py index 0bbab9c..07ccce8 100644 --- a/rwx/ps/__init__.py +++ b/rwx/ps/__init__.py @@ -5,6 +5,10 @@ import subprocess from rwx import txt +class Command: + """Command to run.""" + + def get_tuples_args(*items: str | tuple[str, ...]) -> list[str]: """Turn arguments tuples into an arguments list.""" args: list[str] = []