Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 1 | \section{Standard Module \module{nntplib}} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 2 | \label{module-nntplib} |
Guido van Rossum | a12ef94 | 1995-02-27 17:53:25 +0000 | [diff] [blame] | 3 | \stmodindex{nntplib} |
Fred Drake | 6279fcc | 1998-01-07 13:23:32 +0000 | [diff] [blame] | 4 | \indexii{NNTP}{protocol} |
Guido van Rossum | 8675115 | 1995-02-28 17:14:32 +0000 | [diff] [blame] | 5 | |
Guido van Rossum | 8675115 | 1995-02-28 17:14:32 +0000 | [diff] [blame] | 6 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 7 | This module defines the class \class{NNTP} which implements the client |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 8 | side of the NNTP protocol. It can be used to implement a news reader |
| 9 | or poster, or automated news processors. For more information on NNTP |
Fred Drake | c589124 | 1998-02-09 19:16:20 +0000 | [diff] [blame] | 10 | (Network News Transfer Protocol), see Internet \rfc{977}. |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 12 | Here are two small examples of how it can be used. To list some |
| 13 | statistics about a newsgroup and print the subjects of the last 10 |
| 14 | articles: |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 15 | |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 16 | \begin{verbatim} |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 17 | >>> s = NNTP('news.cwi.nl') |
| 18 | >>> resp, count, first, last, name = s.group('comp.lang.python') |
| 19 | >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last |
| 20 | Group comp.lang.python has 59 articles, range 3742 to 3803 |
| 21 | >>> resp, subs = s.xhdr('subject', first + '-' + last) |
| 22 | >>> for id, sub in subs[-10:]: print id, sub |
| 23 | ... |
| 24 | 3792 Re: Removing elements from a list while iterating... |
| 25 | 3793 Re: Who likes Info files? |
| 26 | 3794 Emacs and doc strings |
| 27 | 3795 a few questions about the Mac implementation |
| 28 | 3796 Re: executable python scripts |
| 29 | 3797 Re: executable python scripts |
| 30 | 3798 Re: a few questions about the Mac implementation |
| 31 | 3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules |
| 32 | 3802 Re: executable python scripts |
Fred Drake | 65b32f7 | 1998-02-09 20:27:12 +0000 | [diff] [blame] | 33 | 3803 Re: \POSIX{} wait and SIGCHLD |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 34 | >>> s.quit() |
| 35 | '205 news.cwi.nl closing connection. Goodbye.' |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 36 | \end{verbatim} |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 37 | |
| 38 | To post an article from a file (this assumes that the article has |
| 39 | valid headers): |
| 40 | |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 41 | \begin{verbatim} |
Guido van Rossum | cca8d2b | 1995-03-22 15:48:46 +0000 | [diff] [blame] | 42 | >>> s = NNTP('news.cwi.nl') |
| 43 | >>> f = open('/tmp/article') |
| 44 | >>> s.post(f) |
| 45 | '240 Article posted successfully.' |
| 46 | >>> s.quit() |
| 47 | '205 news.cwi.nl closing connection. Goodbye.' |
Fred Drake | 1947991 | 1998-02-13 06:58:54 +0000 | [diff] [blame] | 48 | \end{verbatim} |
Guido van Rossum | e47da0a | 1997-07-17 16:34:52 +0000 | [diff] [blame] | 49 | % |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 50 | The module itself defines the following items: |
| 51 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 52 | \begin{classdesc}{NNTP}{host\optional{, port}} |
| 53 | Return a new instance of the \class{NNTP} class, representing a |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 54 | connection to the NNTP server running on host \var{host}, listening at |
| 55 | port \var{port}. The default \var{port} is 119. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 56 | \end{classdesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 57 | |
| 58 | \begin{excdesc}{error_reply} |
| 59 | Exception raised when an unexpected reply is received from the server. |
| 60 | \end{excdesc} |
| 61 | |
| 62 | \begin{excdesc}{error_temp} |
| 63 | Exception raised when an error code in the range 400--499 is received. |
| 64 | \end{excdesc} |
| 65 | |
| 66 | \begin{excdesc}{error_perm} |
| 67 | Exception raised when an error code in the range 500--599 is received. |
| 68 | \end{excdesc} |
| 69 | |
| 70 | \begin{excdesc}{error_proto} |
| 71 | Exception raised when a reply is received from the server that does |
| 72 | not begin with a digit in the range 1--5. |
| 73 | \end{excdesc} |
| 74 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 75 | |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 76 | \subsection{NNTP Objects} |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 77 | \label{nntp-objects} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 78 | |
| 79 | NNTP instances have the following methods. The \var{response} that is |
| 80 | returned as the first item in the return tuple of almost all methods |
| 81 | is the server's response: a string beginning with a three-digit code. |
| 82 | If the server's response indicates an error, the method raises one of |
| 83 | the above exceptions. |
| 84 | |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 85 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 86 | \begin{methoddesc}{getwelcome}{} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 87 | Return the welcome message sent by the server in reply to the initial |
| 88 | connection. (This message sometimes contains disclaimers or help |
| 89 | information that may be relevant to the user.) |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 90 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 91 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 92 | \begin{methoddesc}{set_debuglevel}{level} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 93 | Set the instance's debugging level. This controls the amount of |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 94 | debugging output printed. The default, \code{0}, produces no debugging |
| 95 | output. A value of \code{1} produces a moderate amount of debugging |
| 96 | output, generally a single line per request or response. A value of |
| 97 | \code{2} or higher produces the maximum amount of debugging output, |
| 98 | logging each line sent and received on the connection (including |
| 99 | message text). |
| 100 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 101 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 102 | \begin{methoddesc}{newgroups}{date, time} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 103 | Send a \samp{NEWGROUPS} command. The \var{date} argument should be a |
| 104 | string of the form \code{"\var{yy}\var{mm}\var{dd}"} indicating the |
| 105 | date, and \var{time} should be a string of the form |
| 106 | \code{"\var{hh}\var{mm}\var{ss}"} indicating the time. Return a pair |
| 107 | \code{(\var{response}, \var{groups})} where \var{groups} is a list of |
| 108 | group names that are new since the given date and time. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 109 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 110 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 111 | \begin{methoddesc}{newnews}{group, date, time} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 112 | Send a \samp{NEWNEWS} command. Here, \var{group} is a group name or |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 113 | \code{'*'}, and \var{date} and \var{time} have the same meaning as for |
| 114 | \method{newgroups()}. Return a pair \code{(\var{response}, |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 115 | \var{articles})} where \var{articles} is a list of article ids. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 116 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 117 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 118 | \begin{methoddesc}{list}{} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 119 | Send a \samp{LIST} command. Return a pair \code{(\var{response}, |
| 120 | \var{list})} where \var{list} is a list of tuples. Each tuple has the |
| 121 | form \code{(\var{group}, \var{last}, \var{first}, \var{flag})}, where |
| 122 | \var{group} is a group name, \var{last} and \var{first} are the last |
| 123 | and first article numbers (as strings), and \var{flag} is \code{'y'} |
| 124 | if posting is allowed, \code{'n'} if not, and \code{'m'} if the |
| 125 | newsgroup is moderated. (Note the ordering: \var{last}, \var{first}.) |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 126 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 127 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 128 | \begin{methoddesc}{group}{name} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 129 | Send a \samp{GROUP} command, where \var{name} is the group name. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 130 | Return a tuple \code{(}\var{response}\code{,} \var{count}\code{,} |
| 131 | \var{first}\code{,} \var{last}\code{,} \var{name}\code{)} where |
| 132 | \var{count} is the (estimated) number of articles in the group, |
| 133 | \var{first} is the first article number in the group, \var{last} is |
| 134 | the last article number in the group, and \var{name} is the group |
| 135 | name. The numbers are returned as strings. |
| 136 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 137 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 138 | \begin{methoddesc}{help}{} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 139 | Send a \samp{HELP} command. Return a pair \code{(\var{response}, |
| 140 | \var{list})} where \var{list} is a list of help strings. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 141 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 142 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 143 | \begin{methoddesc}{stat}{id} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 144 | Send a \samp{STAT} command, where \var{id} is the message id (enclosed |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 145 | in \character{<} and \character{>}) or an article number (as a string). |
Fred Drake | 4b3f031 | 1996-12-13 22:04:31 +0000 | [diff] [blame] | 146 | Return a triple \code{(\var{response}, \var{number}, \var{id})} where |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 147 | \var{number} is the article number (as a string) and \var{id} is the |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 148 | article id (enclosed in \character{<} and \character{>}). |
| 149 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 150 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 151 | \begin{methoddesc}{next}{} |
| 152 | Send a \samp{NEXT} command. Return as for \method{stat()}. |
| 153 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 154 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 155 | \begin{methoddesc}{last}{} |
| 156 | Send a \samp{LAST} command. Return as for \method{stat()}. |
| 157 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 158 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 159 | \begin{methoddesc}{head}{id} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 160 | Send a \samp{HEAD} command, where \var{id} has the same meaning as for |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 161 | \method{stat()}. Return a pair \code{(\var{response}, \var{list})} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 162 | where \var{list} is a list of the article's headers (an uninterpreted |
| 163 | list of lines, without trailing newlines). |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 164 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 165 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 166 | \begin{methoddesc}{body}{id} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 167 | Send a \samp{BODY} command, where \var{id} has the same meaning as for |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 168 | \method{stat()}. Return a pair \code{(\var{response}, \var{list})} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 169 | where \var{list} is a list of the article's body text (an |
| 170 | uninterpreted list of lines, without trailing newlines). |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 171 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 172 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 173 | \begin{methoddesc}{article}{id} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 174 | Send a \samp{ARTICLE} command, where \var{id} has the same meaning as |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 175 | for \method{stat()}. Return a pair \code{(\var{response}, \var{list})} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 176 | where \var{list} is a list of the article's header and body text (an |
| 177 | uninterpreted list of lines, without trailing newlines). |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 178 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 179 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 180 | \begin{methoddesc}{slave}{} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 181 | Send a \samp{SLAVE} command. Return the server's \var{response}. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 182 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 183 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 184 | \begin{methoddesc}{xhdr}{header, string} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 185 | Send an \samp{XHDR} command. This command is not defined in the RFC |
| 186 | but is a common extension. The \var{header} argument is a header |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 187 | keyword, e.g. \code{'subject'}. The \var{string} argument should have |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 188 | the form \code{"\var{first}-\var{last}"} where \var{first} and |
| 189 | \var{last} are the first and last article numbers to search. Return a |
| 190 | pair \code{(\var{response}, \var{list})}, where \var{list} is a list of |
| 191 | pairs \code{(\var{id}, \var{text})}, where \var{id} is an article id |
| 192 | (as a string) and \var{text} is the text of the requested header for |
| 193 | that article. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 194 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 195 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 196 | \begin{methoddesc}{post}{file} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 197 | Post an article using the \samp{POST} command. The \var{file} |
| 198 | argument is an open file object which is read until EOF using its |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 199 | \method{readline()} method. It should be a well-formed news article, |
| 200 | including the required headers. The \method{post()} method |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 201 | automatically escapes lines beginning with \samp{.}. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 202 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 203 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 204 | \begin{methoddesc}{ihave}{id, file} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 205 | Send an \samp{IHAVE} command. If the response is not an error, treat |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 206 | \var{file} exactly as for the \method{post()} method. |
| 207 | \end{methoddesc} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 208 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 209 | \begin{methoddesc}{date}{} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 210 | Return a triple \code{(\var{response}, \var{date}, \var{time})}, |
| 211 | containing the current date and time in a form suitable for the |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 212 | \method{newnews()} and \method{newgroups()} methods. |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 213 | This is an optional NNTP extension, and may not be supported by all |
| 214 | servers. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 215 | \end{methoddesc} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 216 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 217 | \begin{methoddesc}{xgtitle}{name} |
| 218 | Process an \samp{XGTITLE} command, returning a pair \code{(\var{response}, |
Fred Drake | fac431e | 1998-02-16 21:57:37 +0000 | [diff] [blame] | 219 | \var{list})}, where \var{list} is a list of tuples containing |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 220 | \code{(\var{name}, \var{title})}. |
| 221 | % XXX huh? Should that be name, description? |
| 222 | This is an optional NNTP extension, and may not be supported by all |
| 223 | servers. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 224 | \end{methoddesc} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 225 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 226 | \begin{methoddesc}{xover}{start, end} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 227 | Return a pair \code{(\var{resp}, \var{list})}. \var{list} is a list |
| 228 | of tuples, one for each article in the range delimited by the \var{start} |
| 229 | and \var{end} article numbers. Each tuple is of the form |
Fred Drake | fac431e | 1998-02-16 21:57:37 +0000 | [diff] [blame] | 230 | \code{(}\var{article number}\code{,} \var{subject}\code{,} |
| 231 | \var{poster}\code{,} \var{date}\code{,} \var{id}\code{,} |
| 232 | \var{references}\code{,} \var{size}\code{,} \var{lines}\code{)}. |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 233 | This is an optional NNTP extension, and may not be supported by all |
| 234 | servers. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 235 | \end{methoddesc} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 236 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 237 | \begin{methoddesc}{xpath}{id} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 238 | Return a pair \code{(\var{resp}, \var{path})}, where \var{path} is the |
| 239 | directory path to the article with message ID \var{id}. This is an |
| 240 | optional NNTP extension, and may not be supported by all servers. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 241 | \end{methoddesc} |
Guido van Rossum | 94adab5 | 1997-06-02 17:27:50 +0000 | [diff] [blame] | 242 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 243 | \begin{methoddesc}{quit}{} |
Guido van Rossum | 1b91cda | 1995-03-24 15:56:02 +0000 | [diff] [blame] | 244 | Send a \samp{QUIT} command and close the connection. Once this method |
| 245 | has been called, no other methods of the NNTP object should be called. |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 246 | \end{methoddesc} |