Compare commits

..

No commits in common. "487d7cb9b2edd5d9d7f058da427c8e2db5a45176" and "26fea93bdb344a180bcf283435c489f81745e38c" have entirely different histories.

8 changed files with 14 additions and 32 deletions

View file

@ -33,7 +33,6 @@ path = "rwx/__init__.py"
[tool.pydoclint]
allow-init-docstring = true
quiet = true
skip-checking-short-docstrings = false
style = "sphinx"

View file

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

View file

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

View file

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

View file

@ -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:

View file

@ -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:

View file

@ -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"""\

View file

@ -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"""\