diff --git a/pyproject.toml b/pyproject.toml index 1d231ec..462a1d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,6 @@ path = "rwx/__init__.py" [tool.pydoclint] allow-init-docstring = true -quiet = true skip-checking-short-docstrings = false style = "sphinx" diff --git a/readme.md b/readme.md index e2beac8..a8a258c 100644 --- a/readme.md +++ b/readme.md @@ -52,7 +52,6 @@ A tiny framework to read, write & execute things. ### Task stack * character constants for box drawing -* common __str__ function * parse pyproject.toml to write commands * write classes for * steps bars to log diff --git a/rwx/__init__.py b/rwx/__init__.py index ee9f51e..a1c5ee6 100644 --- a/rwx/__init__.py +++ b/rwx/__init__.py @@ -1,20 +1,3 @@ """Read Write eXecute.""" __version__ = "0.0.1" - - -class Class: - """Root class.""" - - def __repr__(self) -> str: - """Represent object variables. - - :return: representation - :rtype: str - """ - name = self.__class__.__name__ - attributes = [ - f"{k}={v!r}" for k, v in vars(self).items() if not k.startswith("_") - ] - arguments = ", ".join(attributes) - return f"{name}({arguments})" diff --git a/rwx/err/__init__.py b/rwx/err/__init__.py index 53a63c7..294d8d8 100644 --- a/rwx/err/__init__.py +++ b/rwx/err/__init__.py @@ -1,7 +1,5 @@ """Handle errors.""" -from rwx import Class - -class Error(Class, Exception): +class Error(Exception): """Parent class for all errors.""" diff --git a/rwx/os/abstract.py b/rwx/os/abstract.py index 8b99c28..e985dc5 100644 --- a/rwx/os/abstract.py +++ b/rwx/os/abstract.py @@ -3,10 +3,8 @@ from abc import ABC, abstractmethod from pathlib import Path -from rwx import Class - -class OS(Class, ABC): +class OS(ABC): """Operating System.""" def __init__(self, path: Path) -> None: diff --git a/rwx/os/pm/__init__.py b/rwx/os/pm/__init__.py index b3cacc4..d248e47 100644 --- a/rwx/os/pm/__init__.py +++ b/rwx/os/pm/__init__.py @@ -2,11 +2,10 @@ from abc import ABC, abstractmethod -from rwx import Class from rwx.ps import Command -class PM(Class, ABC): +class PM(ABC): """Package Manager.""" def __init__(self) -> None: diff --git a/rwx/prj/__init__.py b/rwx/prj/__init__.py index 3cba90b..f4a8acb 100644 --- a/rwx/prj/__init__.py +++ b/rwx/prj/__init__.py @@ -2,10 +2,8 @@ from pathlib import Path -from rwx import Class - -class Project(Class): +class Project: """Parent class for any type of project.""" def __init__(self, file: Path) -> None: @@ -15,6 +13,10 @@ class Project(Class): 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"""\ diff --git a/rwx/ps/__init__.py b/rwx/ps/__init__.py index 601aca3..54d58cf 100644 --- a/rwx/ps/__init__.py +++ b/rwx/ps/__init__.py @@ -2,10 +2,10 @@ import subprocess -from rwx import Class, txt +from rwx import txt -class Command(Class): +class Command: """Command to run.""" def __init__(self, *arguments: str | tuple[str, ...]) -> None: @@ -13,6 +13,10 @@ class Command(Class): 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"""\