~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
            mutter("FTP has not: %s: %s", abspath, e)
249
249
            return False
250
250
 
251
 
    def get(self, relpath, retries=0):
 
251
    def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
252
252
        """Get the file at the given relative path.
253
253
 
254
254
        :param relpath: The relative path to the file
258
258
        We're meant to return a file-like object which bzr will
259
259
        then read from. For now we do this via the magic of StringIO
260
260
        """
 
261
        if deprecated_passed(decode):
 
262
            warn(deprecated_in((2,3,0)) %
 
263
                 '"decode" parameter to FtpTransport.get()',
 
264
                 DeprecationWarning, stacklevel=2)
261
265
        try:
262
266
            mutter("FTP get: %s", self._remote_path(relpath))
263
267
            f = self._get_FTP()
275
279
            else:
276
280
                warning("FTP temporary error: %s. Retrying.", str(e))
277
281
                self._reconnect()
278
 
                return self.get(relpath, retries+1)
 
282
                return self.get(relpath, decode, retries+1)
279
283
        except EOFError, e:
280
284
            if retries > _number_of_retries:
281
285
                raise errors.TransportError("FTP control connection closed during GET %s."
285
289
                warning("FTP control connection closed. Trying to reopen.")
286
290
                time.sleep(_sleep_between_retries)
287
291
                self._reconnect()
288
 
                return self.get(relpath, retries+1)
 
292
                return self.get(relpath, decode, retries+1)
289
293
 
290
294
    def put_file(self, relpath, fp, mode=None, retries=0):
291
295
        """Copy the file-like or string object into the location.