From 1a881145f96e3d0dbfd52ca8108f66911965e407 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Thu, 5 Dec 2024 14:19:49 -0500 Subject: [PATCH] Implement a few more specialty remote newsgroup types --- lib/nntp/tiny/remote.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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