[Python-checkins] r77887 - python/trunk/Doc/library/ftplib.rst

georg.brandl python-checkins at python.org
Sun Jan 31 19:51:50 CET 2010


Author: georg.brandl
Date: Sun Jan 31 19:51:49 2010
New Revision: 77887

Log:
Fix-up ftplib documentation:
move exception descriptions to toplevel, not inside a class
remove attribution in "versionadded"
spell and grammar check docstring of FTP_TLS


Modified:
   python/trunk/Doc/library/ftplib.rst

Modified: python/trunk/Doc/library/ftplib.rst
==============================================================================
--- python/trunk/Doc/library/ftplib.rst	(original)
+++ python/trunk/Doc/library/ftplib.rst	Sun Jan 31 19:51:49 2010
@@ -33,8 +33,8 @@
    '226 Transfer complete.'
    >>> ftp.quit()
 
-The module defines the following items:
 
+The module defines the following items:
 
 .. class:: FTP([host[, user[, passwd[, acct[, timeout]]]]])
 
@@ -49,26 +49,26 @@
    .. versionchanged:: 2.6
       *timeout* was added.
 
+
 .. class:: FTP_TLS([host[, user[, passwd[, acct[, keyfile[, certfile[, timeout]]]]]]])
 
    A :class:`FTP` subclass which adds TLS support to FTP as described in
    :rfc:`4217`.
    Connect as usual to port 21 implicitly securing the FTP control connection
-   before authenticating. Securing the data connection requires user to
-   explicitly ask for it by calling :exc:`prot_p()` method.
-   *keyfile* and *certfile* are optional - they can contain a PEM formatted
-   private key and certificate chain file for the SSL connection.
+   before authenticating. Securing the data connection requires the user to
+   explicitly ask for it by calling the :meth:`prot_p` method.
+   *keyfile* and *certfile* are optional -- they can contain a PEM formatted
+   private key and certificate chain file name for the SSL connection.
 
-   .. versionadded:: 2.7 Contributed by Giampaolo Rodola'
+   .. versionadded:: 2.7
 
-
-   Here's a sample session using :class:`FTP_TLS` class:
+   Here's a sample session using the :class:`FTP_TLS` class:
 
    >>> from ftplib import FTP_TLS
    >>> ftps = FTP_TLS('ftp.python.org')
-   >>> ftps.login()              # login anonimously previously securing control channel
-   >>> ftps.prot_p()             # switch to secure data connection
-   >>> ftps.retrlines('LIST')    # list directory content securely
+   >>> ftps.login()           # login anonymously before securing control channel
+   >>> ftps.prot_p()          # switch to secure data connection
+   >>> ftps.retrlines('LIST') # list directory content securely
    total 9
    drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
    drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
@@ -84,43 +84,42 @@
    >>>
 
 
+.. exception:: error_reply
 
-   .. attribute:: all_errors
-
-      The set of all exceptions (as a tuple) that methods of :class:`FTP`
-      instances may raise as a result of problems with the FTP connection (as
-      opposed to programming errors made by the caller).  This set includes the
-      four exceptions listed below as well as :exc:`socket.error` and
-      :exc:`IOError`.
+   Exception raised when an unexpected reply is received from the server.
 
 
-   .. exception:: error_reply
+.. exception:: error_temp
 
-      Exception raised when an unexpected reply is received from the server.
+   Exception raised when an error code in the range 400--499 is received.
 
 
-   .. exception:: error_temp
+.. exception:: error_perm
 
-      Exception raised when an error code in the range 400--499 is received.
+   Exception raised when an error code in the range 500--599 is received.
 
 
-   .. exception:: error_perm
+.. exception:: error_proto
 
-      Exception raised when an error code in the range 500--599 is received.
+   Exception raised when a reply is received from the server that does not
+   begin with a digit in the range 1--5.
 
 
-   .. exception:: error_proto
+.. data:: all_errors
 
-      Exception raised when a reply is received from the server that does not
-      begin with a digit in the range 1--5.
+   The set of all exceptions (as a tuple) that methods of :class:`FTP`
+   instances may raise as a result of problems with the FTP connection (as
+   opposed to programming errors made by the caller).  This set includes the
+   four exceptions listed below as well as :exc:`socket.error` and
+   :exc:`IOError`.
 
 
 .. seealso::
 
    Module :mod:`netrc`
-      Parser for the :file:`.netrc` file format.  The file :file:`.netrc` is typically
-      used by FTP clients to load user authentication information before prompting the
-      user.
+      Parser for the :file:`.netrc` file format.  The file :file:`.netrc` is
+      typically used by FTP clients to load user authentication information
+      before prompting the user.
 
    .. index:: single: ftpmirror.py
 


More information about the Python-checkins mailing list