This commit is contained in:
Marc Beninca 2024-09-15 01:49:39 +02:00
parent 304c2bc617
commit 63c179a0a4
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 10 additions and 0 deletions

View file

@ -10,8 +10,13 @@ class PM(ABC):
def __init__(self) -> None:
"""Set commands."""
self.clean = self.get_clean_command()
self.install = self.get_install_command()
@abstractmethod
def get_clean_command(self) -> Command:
"""Command to clean packages cache."""
@abstractmethod
def get_install_command(self) -> Command:
"""Command to install package(s)."""
@ -19,5 +24,6 @@ class PM(ABC):
def __str__(self) -> str:
"""Return commands."""
return f"""\
clean = {self.clean}
install = {self.install}
"""

View file

@ -7,6 +7,10 @@ from rwx.ps import Command
class APT(PM):
"""Advanced Package Tool."""
def get_clean_command(self) -> Command:
"""Return clean command."""
return Command()
def get_install_command(self) -> Command:
"""Return install command."""
return Command()