Vega strike Python Modules doc
0.5.1
Documentation of the " Modules " folder of Vega strike
|
Public Member Functions | |
def | __init__ |
def | getwelcome |
def | set_debuglevel |
def | putline |
def | putcmd |
def | getline |
def | getresp |
def | getlongresp |
def | shortcmd |
def | longcmd |
def | newgroups |
def | newnews |
def | list |
def | group |
def | help |
def | statparse |
def | statcmd |
def | stat |
def | next |
def | last |
def | artcmd |
def | head |
def | body |
def | article |
def | slave |
def | xhdr |
def | xover |
def | xgtitle |
def | xpath |
def | date |
def | post |
def | ihave |
def | quit |
Data Fields | |
host | |
port | |
sock | |
file | |
debugging | |
welcome | |
Static Public Attributes | |
debug = set_debuglevel | |
Definition at line 94 of file nntplib.py.
def __init__ | ( | self, | |
host, | |||
port = NNTP_PORT , |
|||
user = None , |
|||
password = None , |
|||
readermode = None |
|||
) |
Initialize an instance. Arguments: - host: hostname to connect to - port: port to connect to (default the standard NNTP port) - user: username to authenticate with - password: password to use with username - readermode: if true, send 'mode reader' command after connecting. readermode is sometimes necessary if you are connecting to an NNTP server on the local machine and intend to call reader-specific comamnds, such as `group'. If you get unexpected NNTPPermanentErrors, you might need to set readermode.
Definition at line 96 of file nntplib.py.
def artcmd | ( | self, | |
line, | |||
file = None |
|||
) |
Internal: process a HEAD, BODY or ARTICLE command.
Definition at line 358 of file nntplib.py.
def article | ( | self, | |
id | |||
) |
Process an ARTICLE command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: article number - id: message id - list: the lines of the article
Definition at line 388 of file nntplib.py.
References NNTP.artcmd().
def body | ( | self, | |
id, | |||
file = None |
|||
) |
Process a BODY command. Argument: - id: article number or message id - file: Filename string or file object to store the article in Returns: - resp: server response if successful - nr: article number - id: message id - list: the lines of the article's body or an empty list if file was used
Definition at line 375 of file nntplib.py.
References NNTP.artcmd().
def date | ( | self) |
Process the DATE command. Arguments: None Returns: resp: server response if successful date: Date suitable for newnews/newgroups commands etc. time: Time suitable for newnews/newgroups commands etc.
Definition at line 481 of file nntplib.py.
References NNTP.shortcmd().
def getline | ( | self) |
Internal: return one line from the server, stripping CRLF. Raise EOFError if the connection is closed.
Definition at line 189 of file nntplib.py.
def getlongresp | ( | self, | |
file = None |
|||
) |
Internal: get a response plus following text from the server. Raise various errors if the response indicates an error.
Definition at line 214 of file nntplib.py.
def getresp | ( | self) |
Internal: get a response from the server. Raise various errors if the response indicates an error.
Definition at line 200 of file nntplib.py.
def getwelcome | ( | self) |
Get the welcome message from the server (this is read and squirreled away by __init__()). If the response code is 200, posting is allowed; if it 201, posting is not allowed.
Definition at line 160 of file nntplib.py.
References NNTP.__init__().
def group | ( | self, | |
name | |||
) |
Process a GROUP command. Argument: - group: the group name Returns: - resp: server response if successful - count: number of articles (string) - first: first article number (string) - last: last article number (string) - name: the group name
Definition at line 288 of file nntplib.py.
def head | ( | self, | |
id | |||
) |
Process a HEAD command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: article number - id: message id - list: the lines of the article's header
Definition at line 364 of file nntplib.py.
References NNTP.artcmd().
def help | ( | self) |
Process a HELP command. Returns: - resp: server response if successful - list: list of strings
Definition at line 314 of file nntplib.py.
def ihave | ( | self, | |
id, | |||
f | |||
) |
Process an IHAVE command. Arguments: - id: message-id of the article - f: file containing the article Returns: - resp: server response if successful Note that if the server refuses the article an exception is raised.
Definition at line 524 of file nntplib.py.
References NNTP.getresp(), FTP.getresp(), FTP.putline(), NNTP.putline(), and NNTP.shortcmd().
def last | ( | self) |
Process a LAST command. No arguments. Return as for STAT.
Definition at line 354 of file nntplib.py.
def list | ( | self) |
Process a LIST command. Return: - resp: server response if successful - list: list of (group, last, first, flag) (strings)
Definition at line 277 of file nntplib.py.
def longcmd | ( | self, | |
line, | |||
file = None |
|||
) |
Internal: send a command and get the response plus following text.
Definition at line 250 of file nntplib.py.
def newgroups | ( | self, | |
date, | |||
time | |||
) |
Process a NEWGROUPS command. Arguments: - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if successful - list: list of newsgroup names
Definition at line 255 of file nntplib.py.
def newnews | ( | self, | |
group, | |||
date, | |||
time | |||
) |
Process a NEWNEWS command. Arguments: - group: group name or '*' - date: string 'yymmdd' indicating the date - time: string 'hhmmss' indicating the time Return: - resp: server response if successful - list: list of article ids
Definition at line 265 of file nntplib.py.
def next | ( | self) |
Process a NEXT command. No arguments. Return as for STAT.
Definition at line 350 of file nntplib.py.
def post | ( | self, | |
f | |||
) |
Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if successful
Definition at line 502 of file nntplib.py.
References NNTP.getresp(), FTP.getresp(), FTP.putline(), NNTP.putline(), and NNTP.shortcmd().
def putcmd | ( | self, | |
line | |||
) |
Internal: send one command to the server (through putline()).
Definition at line 184 of file nntplib.py.
References NNTP.putline().
def putline | ( | self, | |
line | |||
) |
Internal: send one line to the server, appending CRLF.
Definition at line 178 of file nntplib.py.
def quit | ( | self) |
Process a QUIT command and close the socket. Returns: - resp: server response if successful
Definition at line 548 of file nntplib.py.
References Chunk.file, FTP.file, NNTP.file, Hook.file, DumbWriter.file, MiniFieldStorage.file, Breakpoint.file, FieldStorage.file, HTTP.file, NNTP.shortcmd(), FTP.sock, NNTP.sock, HTTPConnection.sock, and HTTPSConnection.sock.
def set_debuglevel | ( | self, | |
level | |||
) |
Set the debugging level. Argument 'level' means: 0: no debugging output (default) 1: print commands and responses but not body text etc. 2: also print raw lines read and sent before stripping CR/LF
Definition at line 169 of file nntplib.py.
def shortcmd | ( | self, | |
line | |||
) |
def slave | ( | self) |
Process a SLAVE command. Returns: - resp: server response if successful
Definition at line 399 of file nntplib.py.
References NNTP.shortcmd().
def stat | ( | self, | |
id | |||
) |
Process a STAT command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: the article number - id: the article id
Definition at line 340 of file nntplib.py.
def statcmd | ( | self, | |
line | |||
) |
def statparse | ( | self, | |
resp | |||
) |
Internal: parse the response of a STAT, NEXT or LAST command.
Definition at line 321 of file nntplib.py.
def xgtitle | ( | self, | |
group | |||
) |
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
Definition at line 448 of file nntplib.py.
References NNTP.longcmd().
def xhdr | ( | self, | |
hdr, | |||
str | |||
) |
Process an XHDR command (optional server extension). Arguments: - hdr: the header type (e.g. 'subject') - str: an article nr, a message id, or a range nr1-nr2 Returns: - resp: server response if successful - list: list of (nr, value) strings
Definition at line 405 of file nntplib.py.
References NNTP.longcmd().
def xover | ( | self, | |
start, | |||
end | |||
) |
Process an XOVER command (optional server extension) Arguments: - start: start of range - end: end of range Returns: - resp: server response if successful - list: list of (art-nr, subject, poster, date, id, references, size, lines)
Definition at line 422 of file nntplib.py.
References NNTP.longcmd(), and dospath.split().
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
Definition at line 464 of file nntplib.py.
References NNTP.shortcmd().
|
static |
Definition at line 176 of file nntplib.py.
debugging |
Definition at line 116 of file nntplib.py.
file |
Definition at line 115 of file nntplib.py.
host |
Definition at line 111 of file nntplib.py.
port |
Definition at line 112 of file nntplib.py.
sock |
Definition at line 113 of file nntplib.py.
welcome |
Definition at line 117 of file nntplib.py.