Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dd6c6d9b
Commit
dd6c6d9b
authored
Apr 22, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up some mark up.
parent
e2effbd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
24 deletions
+21
-24
Doc/lib/libnntplib.tex
Doc/lib/libnntplib.tex
+21
-24
No files found.
Doc/lib/libnntplib.tex
View file @
dd6c6d9b
\section
{
\module
{
nntplib
}
---
NNTP protocol client.
}
\declaremodule
{
standard
}{
nntplib
}
NNTP protocol client
}
\declaremodule
{
standard
}{
nntplib
}
\modulesynopsis
{
NNTP protocol client (requires sockets).
}
\indexii
{
NNTP
}{
protocol
}
\index
{
Network News Transfer Protocol
}
This module defines the class
\class
{
NNTP
}
which implements the client
side of the NNTP protocol. It can be used to implement a news reader
or poster, or automated news processors. For more information on NNTP
...
...
@@ -50,7 +49,7 @@ valid headers):
>>> s.quit()
'205 news.cwi.nl closing connection. Goodbye.'
\end{verbatim}
%
The module itself defines the following items:
\begin{classdesc}
{
NNTP
}{
host
\optional
{
, port
...
...
@@ -58,9 +57,9 @@ The module itself defines the following items:
Return a new instance of the
\class
{
NNTP
}
class, representing a
connection to the NNTP server running on host
\var
{
host
}
, listening at
port
\var
{
port
}
. The default
\var
{
port
}
is 119. If the optional
\var
{
user
}
and
\var
{
password
}
are provided, the
\samp
{
AUTHINFO USER
}
and
\samp
{
AUTHINFO PASS
}
commands are used to identify and
authenticate the user to the server.
\var
{
user
}
and
\var
{
password
}
are provided, the
\samp
{
AUTHINFO USER
}
and
\samp
{
AUTHINFO PASS
}
commands are used to
identify and
authenticate the user to the server.
\end{classdesc}
\begin{excdesc}
{
error
_
reply
}
...
...
@@ -81,8 +80,7 @@ not begin with a digit in the range 1--5.
\end{excdesc}
\subsection
{
NNTP Objects
}
\label
{
nntp-objects
}
\subsection
{
NNTP Objects
\label
{
nntp-objects
}}
NNTP instances have the following methods. The
\var
{
response
}
that is
returned as the first item in the return tuple of almost all methods
...
...
@@ -109,9 +107,9 @@ message text).
\begin{methoddesc}
{
newgroups
}{
date, time
}
Send a
\samp
{
NEWGROUPS
}
command. The
\var
{
date
}
argument should be a
string of the form
\code
{
"
\var
{
yy
}
\var
{
mm
}
\var
{
dd
}
"
}
indicating the
string of the form
\code
{
'
\var
{
yy
}
\var
{
mm
}
\var
{
dd
}
'
}
indicating the
date, and
\var
{
time
}
should be a string of the form
\code
{
"
\var
{
hh
}
\var
{
mm
}
\var
{
ss
}
"
}
indicating the time. Return a pair
\code
{
'
\var
{
hh
}
\var
{
mm
}
\var
{
ss
}
'
}
indicating the time. Return a pair
\code
{
(
\var
{
response
}
,
\var
{
groups
}
)
}
where
\var
{
groups
}
is a list of
group names that are new since the given date and time.
\end{methoddesc}
...
...
@@ -128,19 +126,19 @@ Send a \samp{LIST} command. Return a pair \code{(\var{response},
\var
{
list
}
)
}
where
\var
{
list
}
is a list of tuples. Each tuple has the
form
\code
{
(
\var
{
group
}
,
\var
{
last
}
,
\var
{
first
}
,
\var
{
flag
}
)
}
, where
\var
{
group
}
is a group name,
\var
{
last
}
and
\var
{
first
}
are the last
and first article numbers (as strings), and
\var
{
flag
}
is
\code
{
'y'
}
if posting is allowed,
\code
{
'n'
}
if not, and
\code
{
'm'
}
if the
newsgroup is moderated. (Note the ordering:
\var
{
last
}
,
\var
{
first
}
.)
and first article numbers (as strings), and
\var
{
flag
}
is
\code
{
'y'
}
if posting is allowed,
\code
{
'n'
}
if not, and
\code
{
'm'
}
if
the newsgroup is moderated. (Note the ordering:
\var
{
last
}
,
\var
{
first
}
.)
\end{methoddesc}
\begin{methoddesc}
{
group
}{
name
}
Send a
\samp
{
GROUP
}
command, where
\var
{
name
}
is the group name.
Return a tuple
\code
{
(
}
\var
{
response
}
\code
{
,
}
\var
{
count
}
\code
{
,
}
\var
{
first
}
\code
{
,
}
\var
{
last
}
\code
{
,
}
\var
{
name
}
\code
{
)
}
where
\var
{
count
}
is the (estimated) number of articles in the group,
\var
{
first
}
is the first article number in the group,
\var
{
last
}
is
the last article number in the group, and
\var
{
name
}
is the group
name. The numbers are returned as strings.
Return a tuple
\code
{
(
\var
{
response
}
,
\var
{
count
}
,
\var
{
first
}
,
\var
{
last
}
,
\var
{
name
}
)
}
where
\var
{
count
}
is the (estimated) number
of articles in the group,
\var
{
first
}
is the first article number in
the group,
\var
{
last
}
is the last article number in the group, and
\var
{
name
}
is the group name. The numbers are returned as strings.
\end{methoddesc}
\begin{methoddesc}
{
help
}{}
...
...
@@ -191,7 +189,7 @@ Send a \samp{SLAVE} command. Return the server's \var{response}.
Send an
\samp
{
XHDR
}
command. This command is not defined in the RFC
but is a common extension. The
\var
{
header
}
argument is a header
keyword, e.g.
\code
{
'subject'
}
. The
\var
{
string
}
argument should have
the form
\code
{
"
\var
{
first
}
-
\var
{
last
}
"
}
where
\var
{
first
}
and
the form
\code
{
'
\var
{
first
}
-
\var
{
last
}
'
}
where
\var
{
first
}
and
\var
{
last
}
are the first and last article numbers to search. Return a
pair
\code
{
(
\var
{
response
}
,
\var
{
list
}
)
}
, where
\var
{
list
}
is a list of
pairs
\code
{
(
\var
{
id
}
,
\var
{
text
}
)
}
, where
\var
{
id
}
is an article id
...
...
@@ -233,9 +231,8 @@ servers.
Return a pair
\code
{
(
\var
{
resp
}
,
\var
{
list
}
)
}
.
\var
{
list
}
is a list
of tuples, one for each article in the range delimited by the
\var
{
start
}
and
\var
{
end
}
article numbers. Each tuple is of the form
\code
{
(
}
\var
{
article number
}
\code
{
,
}
\var
{
subject
}
\code
{
,
}
\var
{
poster
}
\code
{
,
}
\var
{
date
}
\code
{
,
}
\var
{
id
}
\code
{
,
}
\var
{
references
}
\code
{
,
}
\var
{
size
}
\code
{
,
}
\var
{
lines
}
\code
{
)
}
.
\code
{
(
\var
{
article number
}
,
\var
{
subject
}
,
\var
{
poster
}
,
\var
{
date
}
,
\var
{
id
}
,
\var
{
references
}
,
\var
{
size
}
,
\var
{
lines
}
)
}
.
This is an optional NNTP extension, and may not be supported by all
servers.
\end{methoddesc}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment