This commit is contained in:
Marc Beninca 2024-09-16 11:35:29 +02:00
parent 450e10e2f4
commit b7eec788f7
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
4 changed files with 10 additions and 13 deletions

View file

@ -1,5 +1,7 @@
"""Handle errors."""
from rwx import Class
class Error(Exception):
class Error(Class, Exception):
"""Parent class for all errors."""

View file

@ -2,10 +2,11 @@
from abc import ABC, abstractmethod
from rwx import Class
from rwx.ps import Command
class PM(ABC):
class PM(Class, ABC):
"""Package Manager."""
def __init__(self) -> None:

View file

@ -2,8 +2,10 @@
from pathlib import Path
from rwx import Class
class Project:
class Project(Class):
"""Parent class for any type of project."""
def __init__(self, file: Path) -> None:
@ -13,10 +15,6 @@ class Project:
self.root: Path = self.file.parent
self.name: str = self.root.name
def __repr__(self) -> str:
"""Represent project."""
return f"Project(file={self.raw!r})"
def __str__(self) -> str:
"""Return file, root & name."""
return f"""\

View file

@ -2,10 +2,10 @@
import subprocess
from rwx import txt
from rwx import Class, txt
class Command:
class Command(Class):
"""Command to run."""
def __init__(self, *arguments: str | tuple[str, ...]) -> None:
@ -13,10 +13,6 @@ class Command:
self.raw = arguments
self.flat: list[str] = []
def __repr__(self) -> str:
"""Represent command."""
return f"Command({self.raw!r})"
def __str__(self) -> str:
"""Return raw & flat."""
return f"""\