From 63c179a0a48b237ae5a581ed823c93ce062f83fe Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 15 Sep 2024 01:49:39 +0200 Subject: [PATCH] pm/clean --- rwx/os/pm/__init__.py | 6 ++++++ rwx/os/pm/apt.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/rwx/os/pm/__init__.py b/rwx/os/pm/__init__.py index e359a88..d248e47 100644 --- a/rwx/os/pm/__init__.py +++ b/rwx/os/pm/__init__.py @@ -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} """ diff --git a/rwx/os/pm/apt.py b/rwx/os/pm/apt.py index ac669b6..03217b8 100644 --- a/rwx/os/pm/apt.py +++ b/rwx/os/pm/apt.py @@ -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()