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/host.py

    r1343 r1351  
    3030    # Implementation notes:
    3131    #
    32     # Upon every request of a file (`_FTPFile` object) a new FTP
     32    # Upon every request of a file (`FTPFile` object) a new FTP
    3333    # session is created ("cloned"), leading to a child session of
    3434    # the `FTPHost` object from which the file is requested.
    3535    #
    36     # This is needed because opening an `_FTPFile` will make the
     36    # This is needed because opening an `FTPFile` will make the
    3737    # local session object wait for the completion of the transfer.
    3838    # In fact, code like this would block indefinitely, if the `RETR`
     
    4444    #
    4545    # On the other hand, the initially constructed host object will
    46     # store references to already established `_FTPFile` objects and
    47     # reuse an associated connection if its associated `_FTPFile`
     46    # store references to already established `FTPFile` objects and
     47    # reuse an associated connection if its associated `FTPFile`
    4848    # has been closed.
    4949
     
    6969        self._children = []
    7070        # This is only set to something else than `None` if this
    71         # instance represents an `_FTPFile`.
     71        # instance represents an `FTPFile`.
    7272        self._file = None
    7373        # Now opened.
     
    170170            host = self._copy()
    171171            self._children.append(host)
    172             host._file = ftputil.file._FTPFile(host)
     172            host._file = ftputil.file.FTPFile(host)
    173173        basedir = self.getcwd()
    174174        # Prepare for changing the directory (see whitespace workaround
     
    201201        # Close associated children.
    202202        for host in self._children:
    203             # Children have a `_file` attribute which is an `_FTPFile` object.
     203            # Children have a `_file` attribute which is an `FTPFile` object.
    204204            host._file.close()
    205205            host.close()
Note: See TracChangeset for help on using the changeset viewer.