~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ftp/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2010-08-20 09:52:25 UTC
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: v.ladeuil+lp@free.fr-20100820095225-wijo4emfgvtmu2ku
BzrRemoveChangedFilesError is deprecated in 2.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    osutils,
41
41
    urlutils,
42
42
    )
43
 
from bzrlib.symbol_versioning import (
44
 
    DEPRECATED_PARAMETER,
45
 
    deprecated_in,
46
 
    deprecated_passed,
47
 
    warn,
48
 
    )
49
43
from bzrlib.trace import mutter, warning
50
44
from bzrlib.transport import (
51
45
    AppendBasedFileStream,
170
164
        connection, credentials = self._create_connection(credentials)
171
165
        self._set_connection(connection, credentials)
172
166
 
173
 
    def disconnect(self):
174
 
        connection = self._get_connection()
175
 
        if connection is not None:
176
 
            connection.close()
177
 
 
178
167
    def _translate_ftp_error(self, err, path, extra=None,
179
168
                              unknown_exc=FtpPathError):
180
169
        """Try to translate an ftplib exception to a bzrlib exception.
246
235
            mutter("FTP has not: %s: %s", abspath, e)
247
236
            return False
248
237
 
249
 
    def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
 
238
    def get(self, relpath, decode=False, retries=0):
250
239
        """Get the file at the given relative path.
251
240
 
252
241
        :param relpath: The relative path to the file
256
245
        We're meant to return a file-like object which bzr will
257
246
        then read from. For now we do this via the magic of StringIO
258
247
        """
259
 
        if deprecated_passed(decode):
260
 
            warn(deprecated_in((2,3,0)) %
261
 
                 '"decode" parameter to FtpTransport.get()',
262
 
                 DeprecationWarning, stacklevel=2)
 
248
        # TODO: decode should be deprecated
263
249
        try:
264
250
            mutter("FTP get: %s", self._remote_path(relpath))
265
251
            f = self._get_FTP()