There are no base classes.
There are no implemented interfaces.
There are no attributes in this class.
artcmd(line, file=None)
Internal: process a HEAD, BODY or ARTICLE command.
article(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
body(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
date()
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.
debug(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
description(group)
Get a description for a single group. If more than one
group matches (group
is a pattern), return the first. If no
group matches, return an empty string.
This elides the response code from the server, since it can
only be 215
or 285
(for xgtitle) anyway. If the response
code is needed, use the descriptions
method.
NOTE: This neither checks for a wildcard in group
nor does
it check whether the group actually exists.
descriptions(group_pattern)
Get descriptions for a range of groups.
getline()
Internal: return one line from the server, stripping CRLF. Raise EOFError if the connection is closed.
getlongresp(file=None)
Internal: get a response plus following text from the server. Raise various errors if the response indicates an error.
getresp()
Internal: get a response from the server. Raise various errors if the response indicates an error.
getwelcome()
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.
group(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
head(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
help(file=None)
Process a HELP command. Returns: - resp: server response if successful - list: list of strings
ihave(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.
last()
Process a LAST command. No arguments. Return as for STAT.
list(file=None)
Process a LIST command. Return: - resp: server response if successful - list: list of (group, last, first, flag) (strings)
longcmd(line, file=None)
Internal: send a command and get the response plus following text.
newgroups(date, time, file=None)
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
newnews(group, date, time, file=None)
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 message ids
next()
Process a NEXT command. No arguments. Return as for STAT.
post(f)
Process a POST command. Arguments: - f: file containing the article Returns: - resp: server response if successful
putcmd(line)
Internal: send one command to the server (through putline()).
putline(line)
Internal: send one line to the server, appending CRLF.
quit()
Process a QUIT command and close the socket. Returns: - resp: server response if successful
set_debuglevel(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
shortcmd(line)
Internal: send a command and get the response.
slave()
Process a SLAVE command. Returns: - resp: server response if successful
stat(id)
Process a STAT command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: the article number - id: the message id
statcmd(line)
Internal: process a STAT, NEXT or LAST command.
statparse(resp)
Internal: parse the response of a STAT, NEXT or LAST command.
xgtitle(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
xhdr(hdr, str, file=None)
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
xover(start, end, file=None)
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)
xpath(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
There are no known subclasses.