summaryrefslogtreecommitdiff
path: root/Mailman/interfaces/requests.py
diff options
context:
space:
mode:
authorBarry Warsaw2007-09-09 13:22:27 -0400
committerBarry Warsaw2007-09-09 13:22:27 -0400
commitf1df4e6e79e7ba49ec0638fa4dd867b4043254f3 (patch)
tree7240ead35f058b7abf4caf2b34f3b32813c1b72d /Mailman/interfaces/requests.py
parent3fe9a220e8952853e51dbca359196d1f11dcbdc3 (diff)
downloadmailman-f1df4e6e79e7ba49ec0638fa4dd867b4043254f3.tar.gz
mailman-f1df4e6e79e7ba49ec0638fa4dd867b4043254f3.tar.zst
mailman-f1df4e6e79e7ba49ec0638fa4dd867b4043254f3.zip
ListAdmin mostly gone, but not quite.
Mailman/app/moderator.py: Most of the application level interface provided by ListAdmin is moved here now, including the ability to hold messages, subscriptions, and unsubscriptions, and to handle message (defer, discard, reject, accept). More work needed. Some untested conversion of API in Mailman/Cgi/admindb.py, confirm.py, bin/checkdbs.py. messagestore.py: Don't use or require the Date: header in the global message ID calculation. As described on the mailing list, we're only going to use the Message-ID header. IListRequests: added count_of() and of_type() methods.
Diffstat (limited to 'Mailman/interfaces/requests.py')
-rw-r--r--Mailman/interfaces/requests.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/Mailman/interfaces/requests.py b/Mailman/interfaces/requests.py
index 0a817d43c..b4b5902af 100644
--- a/Mailman/interfaces/requests.py
+++ b/Mailman/interfaces/requests.py
@@ -42,10 +42,17 @@ class IListRequests(Interface):
count = Attribute(
"""The total number of requests held for the mailing list.""")
+ def count_of(request_type):
+ """The total number of requests held of the given request type.
+
+ :param request_type: A `RequestType` enum value.
+ :return: An integer.
+ """
+
def hold_request(request_type, key, data=None):
"""Hold some data for moderator approval.
- :param request_type: A `Request` enum value.
+ :param request_type: A `RequestType` enum value.
:param key: The key piece of request data being held.
:param data: Additional optional data in the form of a dictionary that
is associated with the held request.
@@ -53,12 +60,23 @@ class IListRequests(Interface):
"""
held_requests = Attribute(
- """An iterator over the held requests, yielding a 2-tuple.
+ """An iterator over the held requests.
- The tuple has the form: (id, type) where `id` is the held request's
- unique id and the `type` is a `Request` enum value.
+ Returned items have two attributes:
+ * `id` is the held request's unique id;
+ * `type` is a `RequestType` enum value.
""")
+ def of_type(request_type):
+ """An iterator over the held requests of the given type.
+
+ Returned items have two attributes:
+ * `id` is the held request's unique id;
+ * `type` is a `RequestType` enum value.
+
+ Only items with a matching `type' are returned.
+ """
+
def get_request(request_id):
"""Get the data associated with the request id, or None.