This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: New parameter for an NNTP newsgroup pattern in LIST ACTIVE
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jelie, pitrou
Priority: normal Keywords:

Created on 2010-11-01 20:20 by jelie, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg120160 - (view) Author: Julien ÉLIE (jelie) Date: 2010-11-01 20:20
NNTP.list(*, file=None)

Couldn't a "grouppattern" argument be added?
LIST ACTIVE handles a newsgroup pattern (and it would then answer
less groups -- also useful for the test suite of nntplib)


Something like that:


--- nntplib.py.OLD      2010-11-01 19:04:10.000000000 +0100
+++ nntplib.py  2010-11-01 19:57:50.000000000 +0100
@@ -568,14 +568,18 @@
         cmd = 'NEWNEWS {0} {1} {2}'.format(group, date_str, time_str)
         return self._longcmdstring(cmd, file)

-    def list(self, *, file=None):
+    def list(self, *, group_pattern=None, file=None):
         """Process a LIST command. Argument:
         - file: Filename string or file object to store the result in
         Returns:
         - resp: server response if successful
         - list: list of (group, last, first, flag) (strings)
         """
-        resp, lines = self._longcmdstring('LIST', file)
+        if group_pattern is not None:
+            command = 'LIST ACTIVE ' + group_pattern
+        else:
+            command = 'LIST'
+        resp, lines = self._longcmdstring(command, file)
         return resp, self._grouplist(lines)

     def _getdescriptions(self, group_pattern, return_all):





Then, you could perhaps re-activate the LIST test in the test suite...

    # Disabled with gmane as it produces too much data
    test_list = None



In the documentation:

- .. method:: NNTP.list(*, file=None)
+ .. method:: NNTP.list(*, grouppattern=None, file=None)

and describe it the same way grouppattern is described
in the following command (LIST NEWSGROUPS).
msg120447 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-11-04 21:36
That's a fine addition, I've committed it in r86177.
History
Date User Action Args
2022-04-11 14:57:08adminsetgithub: 54492
2010-11-04 21:36:49pitrousetstatus: open -> closed
resolution: fixed
messages: + msg120447

stage: resolved
2010-11-02 00:24:16r.david.murraysetnosy: + pitrou
2010-11-01 20:20:53jeliecreate