diff options
author | Dong-hee Na <donghee.na92@gmail.com> | 2020-01-23 06:59:43 +0900 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2020-01-23 00:59:43 +0300 |
commit | 211a429db93ad644654c77527c147cadc2d77e5b (patch) | |
tree | 8050c84428af0961a4a6517e79d37be0b768de36 | |
parent | 408ccba206a4fef0e9c67a5631ae16154559ed6b (diff) | |
download | nntplib-211a429db93ad644654c77527c147cadc2d77e5b.tar.gz |
-rw-r--r-- | nntplib.py | 39 | ||||
-rw-r--r-- | nntplib.rst | 27 |
2 files changed, 0 insertions, 66 deletions
@@ -67,7 +67,6 @@ import re import socket import collections import datetime -import warnings import sys try: @@ -834,44 +833,6 @@ class _NNTPBase: fmt = self._getoverviewfmt() return resp, _parse_overview(lines, fmt) - def xgtitle(self, group, *, file=None): - """Process an XGTITLE command (optional server extension) Arguments: - - group: group name wildcard (i.e. news.*) - Returns: - - resp: server response if successful - - list: list of (name,title) strings""" - warnings.warn("The XGTITLE extension is not actively used, " - "use descriptions() instead", - DeprecationWarning, 2) - line_pat = re.compile('^([^ \t]+)[ \t]+(.*)$') - resp, raw_lines = self._longcmdstring('XGTITLE ' + group, file) - lines = [] - for raw_line in raw_lines: - match = line_pat.search(raw_line.strip()) - if match: - lines.append(match.group(1, 2)) - return resp, lines - - def xpath(self, id): - """Process an XPATH command (optional server extension) Arguments: - - id: Message id of article - Returns: - resp: server response if successful - path: directory path to article - """ - warnings.warn("The XPATH extension is not actively used", - DeprecationWarning, 2) - - resp = self._shortcmd('XPATH {0}'.format(id)) - if not resp.startswith('223'): - raise NNTPReplyError(resp) - try: - [resp_num, path] = resp.split() - except ValueError: - raise NNTPReplyError(resp) from None - else: - return resp, path - def date(self): """Process the DATE command. Returns: diff --git a/nntplib.rst b/nntplib.rst index 7697365..e7ec904 100644 --- a/nntplib.rst +++ b/nntplib.rst @@ -542,33 +542,6 @@ them have been superseded by newer commands in :rfc:`3977`. if available. -.. method:: NNTP.xpath(id) - - Return a pair ``(resp, path)``, where *path* is the directory path to the - article with message ID *id*. Most of the time, this extension is not - enabled by NNTP server administrators. - - .. deprecated:: 3.3 - The XPATH extension is not actively used. - - -.. XXX deprecated: - - .. method:: NNTP.xgtitle(name, *, file=None) - - Process an ``XGTITLE`` command, returning a pair ``(response, list)``, where - *list* is a list of tuples containing ``(name, title)``. If the *file* parameter - is supplied, then the output of the ``XGTITLE`` command is stored in a file. - If *file* is a string, then the method will open a file with that name, write - to it then close it. If *file* is a :term:`file object`, then it will start - calling :meth:`write` on it to store the lines of the command output. If *file* - is supplied, then the returned *list* is an empty list. This is an optional NNTP - extension, and may not be supported by all servers. - - :rfc:`2980` says "It is suggested that this extension be deprecated". Use - :meth:`descriptions` or :meth:`description` instead. - - Utility functions ----------------- |