rwx/rwx/os/pm/__init__.py
2024-09-15 01:49:39 +02:00

29 lines
648 B
Python

"""Package Manager."""
from abc import ABC, abstractmethod
from rwx.ps import Command
class PM(ABC):
"""Package Manager."""
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)."""
def __str__(self) -> str:
"""Return commands."""
return f"""\
clean = {self.clean}
install = {self.install}
"""