pm,ps
This commit is contained in:
parent
c5930b4107
commit
f4498f691c
3 changed files with 37 additions and 0 deletions
17
rwx/os/pm/__init__.py
Normal file
17
rwx/os/pm/__init__.py
Normal 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
16
rwx/os/pm/apt.py
Normal 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()
|
|
@ -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] = []
|
||||
|
|
Loading…
Reference in a new issue