diff --git a/lib/nntp/tiny/remote.py b/lib/nntp/tiny/remote.py index a4f2d67..cb2d0a2 100644 --- a/lib/nntp/tiny/remote.py +++ b/lib/nntp/tiny/remote.py @@ -2,10 +2,33 @@ class RemoteException(Exception): pass class RemoteNewsgroup(): + __slots__ = 'name', + + def __init__(self, name: str): + self.name: str = name + + def __str__(self): + return self.name + +class RemoteNewsgroupDescription(RemoteNewsgroup): + __slots__ = 'name', 'description', + + def __init__(self, name: str, description: str): + super().__init__(name) + + self.description: str = description + + def __str__(self): + return "%s %s" % ( + self.name, self.description + ) + +class RemoteNewsgroupOverview(RemoteNewsgroup): __slots__ = 'name', 'low', 'high', 'post', def __init__(self, name: str, low: int, high: int, post: bool): - self.name: str = name + super().__init__(name) + self.low: int = low self.high: int = high self.post: bool = post