Ignore:
Timestamp:
Aug 5, 2013, 6:53:15 AM (6 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Changed `_FTPFile` to `FTPFile`. This still isn't a public API.

Nowadays I tend to omit the leading underscores for functions and
classes on the module level because it impacts the readability
(especially if you have mostly non-public names). Instead I list the
public names in `__all__` although this isn't the official purpose of
`__all__`.

If in doubt, the documentation counts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/file.py

    r1350 r1351  
    118118
    119119
    120 class _FTPFile(object):
     120class FTPFile(object):
    121121    """
    122122    Represents a file-like object associated with an FTP host. File
     
    193193                                    errors=errors, newline=newline)
    194194        self._fobj = fobj
    195         # This comes last so that `close` won't try to close `_FTPFile`
     195        # This comes last so that `close` won't try to close `FTPFile`
    196196        # objects without `_conn` and `_fobj` attributes in case of an
    197197        # error.
     
    238238    def __getattr__(self, attr_name):
    239239        """
    240         Handle requests for attributes unknown to `_FTPFile` objects:
     240        Handle requests for attributes unknown to `FTPFile` objects:
    241241        delegate the requests to the contained file object.
    242242        """
     
    281281                    raise
    282282        finally:
    283             # Restore timeout for socket of `_FTPFile`'s `ftplib.FTP`
     283            # Restore timeout for socket of `FTPFile`'s `ftplib.FTP`
    284284            # object in case the connection is reused later.
    285285            self._session.sock.settimeout(old_timeout)
Note: See TracChangeset for help on using the changeset viewer.