diff --git a/rwx/__init__.py b/rwx/__init__.py index a1c5ee6..ee9f51e 100644 --- a/rwx/__init__.py +++ b/rwx/__init__.py @@ -1,3 +1,20 @@ """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/os/abstract.py b/rwx/os/abstract.py index e985dc5..8b99c28 100644 --- a/rwx/os/abstract.py +++ b/rwx/os/abstract.py @@ -3,8 +3,10 @@ from abc import ABC, abstractmethod from pathlib import Path +from rwx import Class -class OS(ABC): + +class OS(Class, ABC): """Operating System.""" def __init__(self, path: Path) -> None: