diff --git a/check/entity.py b/check/entity.py index 143ac77..3d55705 100644 --- a/check/entity.py +++ b/check/entity.py @@ -12,17 +12,18 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from dataclasses import dataclass + +@dataclass class Repo: """ A Repository """ - - def __init__(self, owner: str, name: str, is_private: bool, is_fork: bool, parent): - self.owner = owner - self.name = name - self.is_private = is_private - self.is_fork = is_fork - self.parent = parent + owner: str + name: str + is_private: bool + is_fork: bool + parent: any = None def __repr__(self) -> str: return self.__str__() @@ -31,13 +32,12 @@ class Repo: return f"{self.owner}/{self.name}" +@dataclass class User: """ A User """ - - def __init__(self, username: str): - self.username = username + username: str def __repr__(self) -> str: return self.__str__() @@ -46,13 +46,12 @@ class User: return self.username +@dataclass class Org: """ A Gitea organisation """ - - def __init__(self, username: str): - self.username = username + username: str def __str__(self) -> str: return self.username