Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
nntplib Namespace Reference

Data Structures

class  NNTPError
 
class  NNTPReplyError
 
class  NNTPTemporaryError
 
class  NNTPPermanentError
 
class  NNTPProtocolError
 
class  NNTPDataError
 
class  NNTP
 

Variables

list __all__
 
 error_reply = NNTPReplyError
 
 error_temp = NNTPTemporaryError
 
 error_perm = NNTPPermanentError
 
 error_proto = NNTPProtocolError
 
 error_data = NNTPDataError
 
int NNTP_PORT = 119
 
list LONGRESP = ['100', '215', '220', '221', '222', '224', '230', '231', '282']
 
string CRLF = '\r\n'
 

Detailed Description

An NNTP client class based on RFC 977: Network News Transfer Protocol.

Example:

>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
Group comp.lang.python has 51 articles, range 5770 to 5821
>>> resp, subs = s.xhdr('subject', first + '-' + last)
>>> resp = s.quit()
>>>

Here 'resp' is the server response line.
Error responses are turned into exceptions.

To post an article from a file:
>>> f = open(filename, 'r') # file containing article, including header
>>> resp = s.post(f)
>>>

For descriptions of all methods, read the comments in the code below.
Note that all arguments and return values representing article numbers
are strings, not numbers, since they are rarely used for calculations.

Variable Documentation

list __all__
Initial value:
1 = ["NNTP","NNTPReplyError","NNTPTemporaryError",
2  "NNTPPermanentError","NNTPProtocolError","NNTPDataError",
3  "error_reply","error_temp","error_perm","error_proto",
4  "error_data",]

Definition at line 36 of file nntplib.py.

string CRLF = '\r\n'

Definition at line 89 of file nntplib.py.

error_data = NNTPDataError

Definition at line 76 of file nntplib.py.

error_perm = NNTPPermanentError

Definition at line 74 of file nntplib.py.

error_proto = NNTPProtocolError

Definition at line 75 of file nntplib.py.

error_reply = NNTPReplyError

Definition at line 72 of file nntplib.py.

error_temp = NNTPTemporaryError

Definition at line 73 of file nntplib.py.

list LONGRESP = ['100', '215', '220', '221', '222', '224', '230', '231', '282']

Definition at line 85 of file nntplib.py.

int NNTP_PORT = 119

Definition at line 81 of file nntplib.py.