Ignore:
Timestamp:
Mar 30, 2013, 7:39:16 PM (6 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Simplified module names (`ftputil.ftp_xyz` -> `ftputil.xyz`).
File:
1 moved

Legend:

Unmodified
Added
Removed
  • ftputil/file.py

    r1150 r1187  
    1 # Copyright (C) 2003-2011, Stefan Schwarzer <sschwarzer@sschwarzer.net>
     1# Copyright (C) 2003-2013, Stefan Schwarzer <sschwarzer@sschwarzer.net>
    22# Copyright (C) 2008, Roger Demetrescu <roger.demetrescu@gmail.com>
    33# See the file LICENSE for licensing terms.
    44
    55"""
    6 ftp_file.py - support for file-like objects on FTP servers
     6ftputil.file - support for file-like objects on FTP servers
    77"""
    88
    9 from ftputil import ftp_error
     9import ftputil.error
    1010
    1111
     
    6666        # Check mode.
    6767        if 'a' in mode:
    68             raise ftp_error.FTPIOError("append mode not supported")
     68            raise ftputil.error.FTPIOError("append mode not supported")
    6969        if mode not in ('r', 'rb', 'w', 'wb'):
    70             raise ftp_error.FTPIOError("invalid mode '%s'" % mode)
     70            raise ftputil.error.FTPIOError("invalid mode '%s'" % mode)
    7171        # Remember convenience variables instead of the mode itself.
    7272        self._bin_mode = 'b' in mode
     
    7575        transfer_type = ('A', 'I')[self._bin_mode]
    7676        command = 'TYPE %s' % transfer_type
    77         ftp_error._try_with_ioerror(self._session.voidcmd, command)
     77        ftputil.error._try_with_ioerror(self._session.voidcmd, command)
    7878        # Make transfer command.
    7979        command_type = ('STOR', 'RETR')[self._read_mode]
     
    8484            mode = mode + 'b'
    8585        # Get connection and file object.
    86         self._conn = ftp_error._try_with_ioerror(
     86        self._conn = ftputil.error._try_with_ioerror(
    8787                       self._session.transfercmd, command)
    8888        self._fo = self._conn.makefile(mode)
     
    227227            self._fo.close()
    228228            self._fo = None
    229             ftp_error._try_with_ioerror(self._conn.close)
     229            ftputil.error._try_with_ioerror(self._conn.close)
    230230            # Set a timeout to prevent waiting until server timeout
    231231            # if we have a server blocking here like in ticket #51.
    232232            self._session.sock.settimeout(self._close_timeout)
    233233            try:
    234                 ftp_error._try_with_ioerror(self._session.voidresp)
    235             except ftp_error.FTPIOError, exception:
     234                ftputil.error._try_with_ioerror(self._session.voidresp)
     235            except ftputil.error.FTPIOError, exception:
    236236                # Ignore some errors, see tickets #51 and #17 at
    237237                # http://ftputil.sschwarzer.net/trac/ticket/51 and
     
    252252            # purposes.
    253253            self.closed = True
    254 
Note: See TracChangeset for help on using the changeset viewer.