Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="prev" href="module-nntplib.html" /> | |
13 | <link rel="parent" href="module-nntplib.html" /> | |
14 | <link rel="next" href="module-smtplib.html" /> | |
15 | <meta name='aesop' content='information' /> | |
16 | <title>11.11.1 NNTP Objects </title> | |
17 | </head> | |
18 | <body> | |
19 | <DIV CLASS="navigation"> | |
20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
22 | <tr> | |
23 | <td class='online-navigation'><a rel="prev" title="11.11 nntplib " | |
24 | href="module-nntplib.html"><img src='../icons/previous.png' | |
25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
26 | <td class='online-navigation'><a rel="parent" title="11.11 nntplib " | |
27 | href="module-nntplib.html"><img src='../icons/up.png' | |
28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
29 | <td class='online-navigation'><a rel="next" title="11.12 smtplib " | |
30 | href="module-smtplib.html"><img src='../icons/next.png' | |
31 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
32 | <td align="center" width="100%">Python Library Reference</td> | |
33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
34 | href="contents.html"><img src='../icons/contents.png' | |
35 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
36 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
37 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
38 | <td class='online-navigation'><a rel="index" title="Index" | |
39 | href="genindex.html"><img src='../icons/index.png' | |
40 | border='0' height='32' alt='Index' width='32' /></A></td> | |
41 | </tr></table> | |
42 | <div class='online-navigation'> | |
43 | <b class="navlabel">Previous:</b> | |
44 | <a class="sectref" rel="prev" href="module-nntplib.html">11.11 nntplib </A> | |
45 | <b class="navlabel">Up:</b> | |
46 | <a class="sectref" rel="parent" href="module-nntplib.html">11.11 nntplib </A> | |
47 | <b class="navlabel">Next:</b> | |
48 | <a class="sectref" rel="next" href="module-smtplib.html">11.12 smtplib </A> | |
49 | </div> | |
50 | <hr /></div> | |
51 | </DIV> | |
52 | <!--End of Navigation Panel--> | |
53 | ||
54 | <H2><A NAME="SECTION00131110000000000000000"></A><A NAME="nntp-objects"></A> | |
55 | <BR> | |
56 | 11.11.1 NNTP Objects | |
57 | </H2> | |
58 | ||
59 | <P> | |
60 | NNTP instances have the following methods. The <var>response</var> that is | |
61 | returned as the first item in the return tuple of almost all methods | |
62 | is the server's response: a string beginning with a three-digit code. | |
63 | If the server's response indicates an error, the method raises one of | |
64 | the above exceptions. | |
65 | ||
66 | <P> | |
67 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
68 | <td><nobr><b><tt id='l2h-3462' xml:id='l2h-3462' class="method">getwelcome</tt></b>(</nobr></td> | |
69 | <td><var></var>)</td></tr></table></dt> | |
70 | <dd> | |
71 | Return the welcome message sent by the server in reply to the initial | |
72 | connection. (This message sometimes contains disclaimers or help | |
73 | information that may be relevant to the user.) | |
74 | </dl> | |
75 | ||
76 | <P> | |
77 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
78 | <td><nobr><b><tt id='l2h-3463' xml:id='l2h-3463' class="method">set_debuglevel</tt></b>(</nobr></td> | |
79 | <td><var>level</var>)</td></tr></table></dt> | |
80 | <dd> | |
81 | Set the instance's debugging level. This controls the amount of | |
82 | debugging output printed. The default, <code>0</code>, produces no debugging | |
83 | output. A value of <code>1</code> produces a moderate amount of debugging | |
84 | output, generally a single line per request or response. A value of | |
85 | <code>2</code> or higher produces the maximum amount of debugging output, | |
86 | logging each line sent and received on the connection (including | |
87 | message text). | |
88 | </dl> | |
89 | ||
90 | <P> | |
91 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
92 | <td><nobr><b><tt id='l2h-3464' xml:id='l2h-3464' class="method">newgroups</tt></b>(</nobr></td> | |
93 | <td><var>date, time, </var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
94 | <dd> | |
95 | Send a "<tt class="samp">NEWGROUPS</tt>" command. The <var>date</var> argument should be a | |
96 | string of the form <code>'<var>yy</var><var>mm</var><var>dd</var>'</code> indicating the | |
97 | date, and <var>time</var> should be a string of the form | |
98 | <code>'<var>hh</var><var>mm</var><var>ss</var>'</code> indicating the time. Return a pair | |
99 | <code>(<var>response</var>, <var>groups</var>)</code> where <var>groups</var> is a list of | |
100 | group names that are new since the given date and time. | |
101 | If the <var>file</var> parameter is supplied, then the output of the | |
102 | "<tt class="samp">NEWGROUPS</tt>" command is stored in a file. If <var>file</var> is a string, | |
103 | then the method will open a file object with that name, write to it | |
104 | then close it. If <var>file</var> is a file object, then it will start | |
105 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
106 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
107 | </dl> | |
108 | ||
109 | <P> | |
110 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
111 | <td><nobr><b><tt id='l2h-3465' xml:id='l2h-3465' class="method">newnews</tt></b>(</nobr></td> | |
112 | <td><var>group, date, time, </var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
113 | <dd> | |
114 | Send a "<tt class="samp">NEWNEWS</tt>" command. Here, <var>group</var> is a group name or | |
115 | <code>'*'</code>, and <var>date</var> and <var>time</var> have the same meaning as for | |
116 | <tt class="method">newgroups()</tt>. Return a pair <code>(<var>response</var>, | |
117 | <var>articles</var>)</code> where <var>articles</var> is a list of message ids. | |
118 | If the <var>file</var> parameter is supplied, then the output of the | |
119 | "<tt class="samp">NEWNEWS</tt>" command is stored in a file. If <var>file</var> is a string, | |
120 | then the method will open a file object with that name, write to it | |
121 | then close it. If <var>file</var> is a file object, then it will start | |
122 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
123 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
124 | </dl> | |
125 | ||
126 | <P> | |
127 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
128 | <td><nobr><b><tt id='l2h-3466' xml:id='l2h-3466' class="method">list</tt></b>(</nobr></td> | |
129 | <td><var></var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
130 | <dd> | |
131 | Send a "<tt class="samp">LIST</tt>" command. Return a pair <code>(<var>response</var>, | |
132 | <var>list</var>)</code> where <var>list</var> is a list of tuples. Each tuple has the | |
133 | form <code>(<var>group</var>, <var>last</var>, <var>first</var>, <var>flag</var>)</code>, where | |
134 | <var>group</var> is a group name, <var>last</var> and <var>first</var> are the last | |
135 | and first article numbers (as strings), and <var>flag</var> is | |
136 | <code>'y'</code> if posting is allowed, <code>'n'</code> if not, and <code>'m'</code> if | |
137 | the newsgroup is moderated. (Note the ordering: <var>last</var>, | |
138 | <var>first</var>.) | |
139 | If the <var>file</var> parameter is supplied, then the output of the | |
140 | "<tt class="samp">LIST</tt>" command is stored in a file. If <var>file</var> is a string, | |
141 | then the method will open a file object with that name, write to it | |
142 | then close it. If <var>file</var> is a file object, then it will start | |
143 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
144 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
145 | </dl> | |
146 | ||
147 | <P> | |
148 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
149 | <td><nobr><b><tt id='l2h-3467' xml:id='l2h-3467' class="method">descriptions</tt></b>(</nobr></td> | |
150 | <td><var>grouppattern</var>)</td></tr></table></dt> | |
151 | <dd> | |
152 | Send a "<tt class="samp">LIST NEWSGROUPS</tt>" command, where <var>grouppattern</var> is a wildmat | |
153 | string as specified in RFC2980 (it's essentially the same as DOS or UNIX | |
154 | shell wildcard strings). Return a pair <code>(<var>response</var>, | |
155 | <var>list</var>)</code>, where <var>list</var> is a list of tuples containing | |
156 | <code>(<var>name</var>, <var>title</var>)</code>. | |
157 | ||
158 | <P> | |
159 | ||
160 | <span class="versionnote">New in version 2.4.</span> | |
161 | ||
162 | </dl> | |
163 | ||
164 | <P> | |
165 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
166 | <td><nobr><b><tt id='l2h-3468' xml:id='l2h-3468' class="method">description</tt></b>(</nobr></td> | |
167 | <td><var>group</var>)</td></tr></table></dt> | |
168 | <dd> | |
169 | Get a description for a single group <var>group</var>. If more than one group | |
170 | matches (if 'group' is a real wildmat string), return the first match. | |
171 | If no group matches, return an empty string. | |
172 | ||
173 | <P> | |
174 | This elides the response code from the server. If the response code is | |
175 | needed, use <tt class="method">descriptions()</tt>. | |
176 | ||
177 | <P> | |
178 | ||
179 | <span class="versionnote">New in version 2.4.</span> | |
180 | ||
181 | </dl> | |
182 | ||
183 | <P> | |
184 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
185 | <td><nobr><b><tt id='l2h-3469' xml:id='l2h-3469' class="method">group</tt></b>(</nobr></td> | |
186 | <td><var>name</var>)</td></tr></table></dt> | |
187 | <dd> | |
188 | Send a "<tt class="samp">GROUP</tt>" command, where <var>name</var> is the group name. | |
189 | Return a tuple <code>(<var>response</var>, <var>count</var>, <var>first</var>, | |
190 | <var>last</var>, <var>name</var>)</code> where <var>count</var> is the (estimated) number | |
191 | of articles in the group, <var>first</var> is the first article number in | |
192 | the group, <var>last</var> is the last article number in the group, and | |
193 | <var>name</var> is the group name. The numbers are returned as strings. | |
194 | </dl> | |
195 | ||
196 | <P> | |
197 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
198 | <td><nobr><b><tt id='l2h-3470' xml:id='l2h-3470' class="method">help</tt></b>(</nobr></td> | |
199 | <td><var></var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
200 | <dd> | |
201 | Send a "<tt class="samp">HELP</tt>" command. Return a pair <code>(<var>response</var>, | |
202 | <var>list</var>)</code> where <var>list</var> is a list of help strings. | |
203 | If the <var>file</var> parameter is supplied, then the output of the | |
204 | "<tt class="samp">HELP</tt>" command is stored in a file. If <var>file</var> is a string, | |
205 | then the method will open a file object with that name, write to it | |
206 | then close it. If <var>file</var> is a file object, then it will start | |
207 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
208 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
209 | </dl> | |
210 | ||
211 | <P> | |
212 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
213 | <td><nobr><b><tt id='l2h-3471' xml:id='l2h-3471' class="method">stat</tt></b>(</nobr></td> | |
214 | <td><var>id</var>)</td></tr></table></dt> | |
215 | <dd> | |
216 | Send a "<tt class="samp">STAT</tt>" command, where <var>id</var> is the message id (enclosed | |
217 | in "<tt class="character"><</tt>" and "<tt class="character">></tt>") or an article number (as a string). | |
218 | Return a triple <code>(<var>response</var>, <var>number</var>, <var>id</var>)</code> where | |
219 | <var>number</var> is the article number (as a string) and <var>id</var> is the | |
220 | message id (enclosed in "<tt class="character"><</tt>" and "<tt class="character">></tt>"). | |
221 | </dl> | |
222 | ||
223 | <P> | |
224 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
225 | <td><nobr><b><tt id='l2h-3472' xml:id='l2h-3472' class="method">next</tt></b>(</nobr></td> | |
226 | <td><var></var>)</td></tr></table></dt> | |
227 | <dd> | |
228 | Send a "<tt class="samp">NEXT</tt>" command. Return as for <tt class="method">stat()</tt>. | |
229 | </dl> | |
230 | ||
231 | <P> | |
232 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
233 | <td><nobr><b><tt id='l2h-3473' xml:id='l2h-3473' class="method">last</tt></b>(</nobr></td> | |
234 | <td><var></var>)</td></tr></table></dt> | |
235 | <dd> | |
236 | Send a "<tt class="samp">LAST</tt>" command. Return as for <tt class="method">stat()</tt>. | |
237 | </dl> | |
238 | ||
239 | <P> | |
240 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
241 | <td><nobr><b><tt id='l2h-3474' xml:id='l2h-3474' class="method">head</tt></b>(</nobr></td> | |
242 | <td><var>id</var>)</td></tr></table></dt> | |
243 | <dd> | |
244 | Send a "<tt class="samp">HEAD</tt>" command, where <var>id</var> has the same meaning as for | |
245 | <tt class="method">stat()</tt>. Return a tuple | |
246 | <code>(<var>response</var>, <var>number</var>, <var>id</var>, <var>list</var>)</code> | |
247 | where the first three are the same as for <tt class="method">stat()</tt>, | |
248 | and <var>list</var> is a list of the article's headers (an uninterpreted | |
249 | list of lines, without trailing newlines). | |
250 | </dl> | |
251 | ||
252 | <P> | |
253 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
254 | <td><nobr><b><tt id='l2h-3475' xml:id='l2h-3475' class="method">body</tt></b>(</nobr></td> | |
255 | <td><var>id,</var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
256 | <dd> | |
257 | Send a "<tt class="samp">BODY</tt>" command, where <var>id</var> has the same meaning as for | |
258 | <tt class="method">stat()</tt>. If the <var>file</var> parameter is supplied, then | |
259 | the body is stored in a file. If <var>file</var> is a string, then | |
260 | the method will open a file object with that name, write to it then close it. | |
261 | If <var>file</var> is a file object, then it will start calling | |
262 | <tt class="method">write()</tt> on it to store the lines of the body. | |
263 | Return as for <tt class="method">head()</tt>. If <var>file</var> is supplied, then | |
264 | the returned <var>list</var> is an empty list. | |
265 | </dl> | |
266 | ||
267 | <P> | |
268 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
269 | <td><nobr><b><tt id='l2h-3476' xml:id='l2h-3476' class="method">article</tt></b>(</nobr></td> | |
270 | <td><var>id</var>)</td></tr></table></dt> | |
271 | <dd> | |
272 | Send an "<tt class="samp">ARTICLE</tt>" command, where <var>id</var> has the same meaning as | |
273 | for <tt class="method">stat()</tt>. Return as for <tt class="method">head()</tt>. | |
274 | </dl> | |
275 | ||
276 | <P> | |
277 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
278 | <td><nobr><b><tt id='l2h-3477' xml:id='l2h-3477' class="method">slave</tt></b>(</nobr></td> | |
279 | <td><var></var>)</td></tr></table></dt> | |
280 | <dd> | |
281 | Send a "<tt class="samp">SLAVE</tt>" command. Return the server's <var>response</var>. | |
282 | </dl> | |
283 | ||
284 | <P> | |
285 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
286 | <td><nobr><b><tt id='l2h-3478' xml:id='l2h-3478' class="method">xhdr</tt></b>(</nobr></td> | |
287 | <td><var>header, string, </var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
288 | <dd> | |
289 | Send an "<tt class="samp">XHDR</tt>" command. This command is not defined in the RFC | |
290 | but is a common extension. The <var>header</var> argument is a header | |
291 | keyword, e.g. <code>'subject'</code>. The <var>string</var> argument should have | |
292 | the form <code>'<var>first</var>-<var>last</var>'</code> where <var>first</var> and | |
293 | <var>last</var> are the first and last article numbers to search. Return a | |
294 | pair <code>(<var>response</var>, <var>list</var>)</code>, where <var>list</var> is a list of | |
295 | pairs <code>(<var>id</var>, <var>text</var>)</code>, where <var>id</var> is an article number | |
296 | (as a string) and <var>text</var> is the text of the requested header for | |
297 | that article. | |
298 | If the <var>file</var> parameter is supplied, then the output of the | |
299 | "<tt class="samp">XHDR</tt>" command is stored in a file. If <var>file</var> is a string, | |
300 | then the method will open a file object with that name, write to it | |
301 | then close it. If <var>file</var> is a file object, then it will start | |
302 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
303 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
304 | </dl> | |
305 | ||
306 | <P> | |
307 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
308 | <td><nobr><b><tt id='l2h-3479' xml:id='l2h-3479' class="method">post</tt></b>(</nobr></td> | |
309 | <td><var>file</var>)</td></tr></table></dt> | |
310 | <dd> | |
311 | Post an article using the "<tt class="samp">POST</tt>" command. The <var>file</var> | |
312 | argument is an open file object which is read until EOF using its | |
313 | <tt class="method">readline()</tt> method. It should be a well-formed news article, | |
314 | including the required headers. The <tt class="method">post()</tt> method | |
315 | automatically escapes lines beginning with "<tt class="samp">.</tt>". | |
316 | </dl> | |
317 | ||
318 | <P> | |
319 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
320 | <td><nobr><b><tt id='l2h-3480' xml:id='l2h-3480' class="method">ihave</tt></b>(</nobr></td> | |
321 | <td><var>id, file</var>)</td></tr></table></dt> | |
322 | <dd> | |
323 | Send an "<tt class="samp">IHAVE</tt>" command. <var>id</var> is a message id (enclosed in | |
324 | "<tt class="character"><</tt>" and "<tt class="character">></tt>"). | |
325 | If the response is not an error, treat | |
326 | <var>file</var> exactly as for the <tt class="method">post()</tt> method. | |
327 | </dl> | |
328 | ||
329 | <P> | |
330 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
331 | <td><nobr><b><tt id='l2h-3481' xml:id='l2h-3481' class="method">date</tt></b>(</nobr></td> | |
332 | <td><var></var>)</td></tr></table></dt> | |
333 | <dd> | |
334 | Return a triple <code>(<var>response</var>, <var>date</var>, <var>time</var>)</code>, | |
335 | containing the current date and time in a form suitable for the | |
336 | <tt class="method">newnews()</tt> and <tt class="method">newgroups()</tt> methods. | |
337 | This is an optional NNTP extension, and may not be supported by all | |
338 | servers. | |
339 | </dl> | |
340 | ||
341 | <P> | |
342 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
343 | <td><nobr><b><tt id='l2h-3482' xml:id='l2h-3482' class="method">xgtitle</tt></b>(</nobr></td> | |
344 | <td><var>name, </var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
345 | <dd> | |
346 | Process an "<tt class="samp">XGTITLE</tt>" command, returning a pair <code>(<var>response</var>, | |
347 | <var>list</var>)</code>, where <var>list</var> is a list of tuples containing | |
348 | <code>(<var>name</var>, <var>title</var>)</code>. | |
349 | If the <var>file</var> parameter is supplied, then the output of the | |
350 | "<tt class="samp">XGTITLE</tt>" command is stored in a file. If <var>file</var> is a string, | |
351 | then the method will open a file object with that name, write to it | |
352 | then close it. If <var>file</var> is a file object, then it will start | |
353 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
354 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
355 | This is an optional NNTP extension, and may not be supported by all | |
356 | servers. | |
357 | ||
358 | <P> | |
359 | RFC2980 says ``It is suggested that this extension be deprecated''. Use | |
360 | <tt class="method">descriptions()</tt> or <tt class="method">description()</tt> instead. | |
361 | </dl> | |
362 | ||
363 | <P> | |
364 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
365 | <td><nobr><b><tt id='l2h-3483' xml:id='l2h-3483' class="method">xover</tt></b>(</nobr></td> | |
366 | <td><var>start, end, </var><big>[</big><var>file</var><big>]</big><var></var>)</td></tr></table></dt> | |
367 | <dd> | |
368 | Return a pair <code>(<var>resp</var>, <var>list</var>)</code>. <var>list</var> is a list | |
369 | of tuples, one for each article in the range delimited by the <var>start</var> | |
370 | and <var>end</var> article numbers. Each tuple is of the form | |
371 | <code>(<var>article number</var>, <var>subject</var>, <var>poster</var>, <var>date</var>, | |
372 | <var>id</var>, <var>references</var>, <var>size</var>, <var>lines</var>)</code>. | |
373 | If the <var>file</var> parameter is supplied, then the output of the | |
374 | "<tt class="samp">XOVER</tt>" command is stored in a file. If <var>file</var> is a string, | |
375 | then the method will open a file object with that name, write to it | |
376 | then close it. If <var>file</var> is a file object, then it will start | |
377 | calling <tt class="method">write()</tt> on it to store the lines of the command output. | |
378 | If <var>file</var> is supplied, then the returned <var>list</var> is an empty list. | |
379 | This is an optional NNTP extension, and may not be supported by all | |
380 | servers. | |
381 | </dl> | |
382 | ||
383 | <P> | |
384 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
385 | <td><nobr><b><tt id='l2h-3484' xml:id='l2h-3484' class="method">xpath</tt></b>(</nobr></td> | |
386 | <td><var>id</var>)</td></tr></table></dt> | |
387 | <dd> | |
388 | Return a pair <code>(<var>resp</var>, <var>path</var>)</code>, where <var>path</var> is the | |
389 | directory path to the article with message ID <var>id</var>. This is an | |
390 | optional NNTP extension, and may not be supported by all servers. | |
391 | </dl> | |
392 | ||
393 | <P> | |
394 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
395 | <td><nobr><b><tt id='l2h-3485' xml:id='l2h-3485' class="method">quit</tt></b>(</nobr></td> | |
396 | <td><var></var>)</td></tr></table></dt> | |
397 | <dd> | |
398 | Send a "<tt class="samp">QUIT</tt>" command and close the connection. Once this method | |
399 | has been called, no other methods of the NNTP object should be called. | |
400 | </dl> | |
401 | ||
402 | <DIV CLASS="navigation"> | |
403 | <div class='online-navigation'> | |
404 | <p></p><hr /> | |
405 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
406 | <tr> | |
407 | <td class='online-navigation'><a rel="prev" title="11.11 nntplib " | |
408 | href="module-nntplib.html"><img src='../icons/previous.png' | |
409 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
410 | <td class='online-navigation'><a rel="parent" title="11.11 nntplib " | |
411 | href="module-nntplib.html"><img src='../icons/up.png' | |
412 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
413 | <td class='online-navigation'><a rel="next" title="11.12 smtplib " | |
414 | href="module-smtplib.html"><img src='../icons/next.png' | |
415 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
416 | <td align="center" width="100%">Python Library Reference</td> | |
417 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
418 | href="contents.html"><img src='../icons/contents.png' | |
419 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
420 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
421 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
422 | <td class='online-navigation'><a rel="index" title="Index" | |
423 | href="genindex.html"><img src='../icons/index.png' | |
424 | border='0' height='32' alt='Index' width='32' /></A></td> | |
425 | </tr></table> | |
426 | <div class='online-navigation'> | |
427 | <b class="navlabel">Previous:</b> | |
428 | <a class="sectref" rel="prev" href="module-nntplib.html">11.11 nntplib </A> | |
429 | <b class="navlabel">Up:</b> | |
430 | <a class="sectref" rel="parent" href="module-nntplib.html">11.11 nntplib </A> | |
431 | <b class="navlabel">Next:</b> | |
432 | <a class="sectref" rel="next" href="module-smtplib.html">11.12 smtplib </A> | |
433 | </div> | |
434 | </div> | |
435 | <hr /> | |
436 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
437 | </DIV> | |
438 | <!--End of Navigation Panel--> | |
439 | <ADDRESS> | |
440 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
441 | </ADDRESS> | |
442 | </BODY> | |
443 | </HTML> |