[Python-checkins] python/dist/src/Doc/lib libnntplib.tex,1.28,1.29

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Sat, 19 Apr 2003 11:05:26 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv12530/Doc/lib

Modified Files:
	libnntplib.tex 
Log Message:
- Several methods of nntplib.NNTP have grown an optional file argument
  which specifies a file where to divert the command's output
  (already supported by the body() method).  (SF patch #720468)
  Thanks to Terry Carroll.


Index: libnntplib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libnntplib.tex,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** libnntplib.tex	31 Dec 2002 15:28:44 -0000	1.28
--- libnntplib.tex	19 Apr 2003 18:04:53 -0000	1.29
***************
*** 133,137 ****
  \end{methoddesc}
  
! \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
--- 133,137 ----
  \end{methoddesc}
  
! \begin{methoddesc}{newgroups}{date, time, \optional{file}}
  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
***************
*** 140,153 ****
  \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}
  
! \begin{methoddesc}{newnews}{group, date, time}
  Send a \samp{NEWNEWS} command.  Here, \var{group} is a group name or
  \code{'*'}, and \var{date} and \var{time} have the same meaning as for
  \method{newgroups()}.  Return a pair \code{(\var{response},
  \var{articles})} where \var{articles} is a list of article ids.
  \end{methoddesc}
  
! \begin{methoddesc}{list}{}
  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
--- 140,165 ----
  \code{(\var{response}, \var{groups})} where \var{groups} is a list of
  group names that are new since the given date and time.
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{NEWGROUPS} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  \end{methoddesc}
  
! \begin{methoddesc}{newnews}{group, date, time, \optional{file}}
  Send a \samp{NEWNEWS} command.  Here, \var{group} is a group name or
  \code{'*'}, and \var{date} and \var{time} have the same meaning as for
  \method{newgroups()}.  Return a pair \code{(\var{response},
  \var{articles})} where \var{articles} is a list of article ids.
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{NEWNEWS} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  \end{methoddesc}
  
! \begin{methoddesc}{list}{\optional{file}}
  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
***************
*** 158,161 ****
--- 170,179 ----
  the newsgroup is moderated.  (Note the ordering: \var{last},
  \var{first}.)
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{LIST} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  \end{methoddesc}
  
***************
*** 169,175 ****
  \end{methoddesc}
  
! \begin{methoddesc}{help}{}
  Send a \samp{HELP} command.  Return a pair \code{(\var{response},
  \var{list})} where \var{list} is a list of help strings.
  \end{methoddesc}
  
--- 187,199 ----
  \end{methoddesc}
  
! \begin{methoddesc}{help}{\optional{file}}
  Send a \samp{HELP} command.  Return a pair \code{(\var{response},
  \var{list})} where \var{list} is a list of help strings.
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{HELP} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  \end{methoddesc}
  
***************
*** 206,210 ****
  If \var{file} is a file object, then it will start calling
  \method{write()} on it to store the lines of the body.
! Return as for \method{head()}.  If \var{file} is supplied. Then
  the returned \var{list} is an empty list.
  \end{methoddesc}
--- 230,234 ----
  If \var{file} is a file object, then it will start calling
  \method{write()} on it to store the lines of the body.
! Return as for \method{head()}.  If \var{file} is supplied, then
  the returned \var{list} is an empty list.
  \end{methoddesc}
***************
*** 219,223 ****
  \end{methoddesc}
  
! \begin{methoddesc}{xhdr}{header, string}
  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
--- 243,247 ----
  \end{methoddesc}
  
! \begin{methoddesc}{xhdr}{header, string, \optional{file}}
  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
***************
*** 229,232 ****
--- 253,262 ----
  (as a string) and \var{text} is the text of the requested header for
  that article.
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{XHDR} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  \end{methoddesc}
  
***************
*** 252,265 ****
  \end{methoddesc}
  
! \begin{methoddesc}{xgtitle}{name}
  Process an \samp{XGTITLE} command, returning a pair \code{(\var{response},
  \var{list})}, where \var{list} is a list of tuples containing
  \code{(\var{name}, \var{title})}.
  % XXX huh?  Should that be name, description?
  This is an optional NNTP extension, and may not be supported by all
  servers.
  \end{methoddesc}
  
! \begin{methoddesc}{xover}{start, end}
  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}
--- 282,301 ----
  \end{methoddesc}
  
! \begin{methoddesc}{xgtitle}{name, \optional{file}}
  Process an \samp{XGTITLE} command, returning a pair \code{(\var{response},
  \var{list})}, where \var{list} is a list of tuples containing
  \code{(\var{name}, \var{title})}.
  % XXX huh?  Should that be name, description?
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{XGTITLE} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  This is an optional NNTP extension, and may not be supported by all
  servers.
  \end{methoddesc}
  
! \begin{methoddesc}{xover}{start, end, \optional{file}}
  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}
***************
*** 267,270 ****
--- 303,312 ----
  \code{(\var{article number}, \var{subject}, \var{poster}, \var{date},
  \var{id}, \var{references}, \var{size}, \var{lines})}.
+ If the \var{file} parameter is supplied, then the output of the 
+ \samp{XOVER} command is stored in a file.  If \var{file} is a string, 
+ then the method will open a file object with that name, write to it 
+ then close it.  If \var{file} is a file object, then it will start
+ calling \method{write()} on it to store the lines of the command output.
+ If \var{file} is supplied, then the returned \var{list} is an empty list.
  This is an optional NNTP extension, and may not be supported by all
  servers.