This commit is contained in:
Marc Beninca 2024-09-14 17:43:37 +02:00
parent c5930b4107
commit f4498f691c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 37 additions and 0 deletions

17
rwx/os/pm/__init__.py Normal file
View file

@ -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)."""

16
rwx/os/pm/apt.py Normal file
View file

@ -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()

View file

@ -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] = []