Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41d8463

Browse files
committed
Document the API changes to the nntplib module (exceptions become
classes, NNTP.__init__() grows a new optional argument to set reader mode on the server).
1 parent 9dd7872 commit 41d8463

1 file changed

Lines changed: 40 additions & 14 deletions

File tree

Doc/lib/libnntplib.tex

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,57 @@ \section{\module{nntplib} ---
5353
The module itself defines the following items:
5454

5555
\begin{classdesc}{NNTP}{host\optional{, port
56-
\optional{, user\optional{, password}}}}
56+
\optional{, user\optional{, password
57+
\optional{, readermode}}}}}
5758
Return a new instance of the \class{NNTP} class, representing a
5859
connection to the NNTP server running on host \var{host}, listening at
5960
port \var{port}. The default \var{port} is 119. If the optional
6061
\var{user} and \var{password} are provided, the
6162
\samp{AUTHINFO USER} and \samp{AUTHINFO PASS} commands are used to
62-
identify and authenticate the user to the server.
63+
identify and authenticate the user to the server. If the optional
64+
flag \var{readermode} is true, then a \samp{mode reader} command is
65+
sent before authentication is performed. Reader mode is sometimes
66+
necessary if you are connecting to an NNTP server on the local machine
67+
and intend to call reader-specific commands, such as \samp{group}. If
68+
you get unexpected \code{NNTPPermanentError}s, you might need to set
69+
\var{readermode}. \var{readermode} defaults to \code{None}.
6370
\end{classdesc}
6471

65-
\begin{excdesc}{error_reply}
66-
Exception raised when an unexpected reply is received from the server.
67-
\end{excdesc}
72+
\begin{classdesc}{NNTPError}{}
73+
Derived from the standard exception \code{Exception}, this is the base
74+
class for all exceptions raised by the \code{nntplib} module.
75+
\end{classdesc}
76+
77+
\begin{classdesc}{NNTPReplyError}{}
78+
Exception raised when an unexpected reply is received from the
79+
server. For backwards compatibility, the exception \code{error_reply}
80+
is equivalent to this class.
81+
\end{classdesc}
6882

69-
\begin{excdesc}{error_temp}
70-
Exception raised when an error code in the range 400--499 is received.
71-
\end{excdesc}
83+
\begin{classdesc}{NNTPTemporaryError}{}
84+
Exception raised when an error code in the range 400--499 is
85+
received. For backwards compatibility, the exception
86+
\code{error_temp} is equivalent to this class.
87+
\end{classdesc}
7288

73-
\begin{excdesc}{error_perm}
74-
Exception raised when an error code in the range 500--599 is received.
75-
\end{excdesc}
89+
\begin{classdesc}{NNTPPermanentError}{}
90+
Exception raised when an error code in the range 500--599 is
91+
received. For backwards compatibility, the exception
92+
\code{error_perm} is equivalent to this class.
93+
\end{classdesc}
7694

77-
\begin{excdesc}{error_proto}
95+
\begin{classdesc}{NNTPProtocolError}{}
7896
Exception raised when a reply is received from the server that does
79-
not begin with a digit in the range 1--5.
80-
\end{excdesc}
97+
not begin with a digit in the range 1--5. For backwards
98+
compatibility, the exception \code{error_proto} is equivalent to this
99+
class.
100+
\end{classdesc}
101+
102+
\begin{classdesc}{NNTPDataError}{}
103+
Exception raised when there is some error in the response data. For
104+
backwards compatibility, the exception \code{error_data} is
105+
equivalent to this class.
106+
\end{classdesc}
81107

82108

83109
\subsection{NNTP Objects \label{nntp-objects}}

0 commit comments

Comments
 (0)