~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ftp.py

  • Committer: Aaron Bentley
  • Date: 2007-04-16 21:12:29 UTC
  • mto: (1551.19.24 Aaron's mergeable stuff)
  • mto: This revision was merged to the branch mainline in revision 2423.
  • Revision ID: abentley@panoramicfeedback.com-20070416211229-xa9pdlxs721oxhyx
Revert now-unnecessary changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
    def rmdir(self, rel_path):
361
361
        """Delete the directory at rel_path"""
362
362
        abspath = self._abspath(rel_path)
363
 
        f = self._get_FTP()
364
 
        self._rmdir(abspath, f)
365
 
 
366
 
    def _rmdir(self, abspath, f):
367
363
        try:
368
364
            mutter("FTP rmd: %s", abspath)
 
365
            f = self._get_FTP()
369
366
            f.rmd(abspath)
370
367
        except ftplib.error_perm, e:
371
 
            self._translate_perm_error(e, abspath,
372
 
                                       unknown_exc=errors.PathError)
 
368
            self._translate_perm_error(e, abspath, unknown_exc=errors.PathError)
373
369
 
374
370
    def append_file(self, relpath, f, mode=None):
375
371
        """Append the text in the file-like object into the final
471
467
 
472
468
        Using the implementation provided by osutils.
473
469
        """
474
 
        def delete_or_rmdir(abspath):
475
 
            try:
476
 
                self._delete(abspath, f)
477
 
            except errors.NoSuchFile, e:
478
 
                self._rmdir(abspath, f)
479
 
 
480
470
        osutils.fancy_rename(abs_from, abs_to,
481
 
            rename_func=lambda p1, p2:self._rename(p1, p2, f),
482
 
            unlink_func=delete_or_rmdir)
 
471
            rename_func=lambda p1, p2: self._rename(p1, p2, f),
 
472
            unlink_func=lambda p: self._delete(p, f))
483
473
 
484
474
    def delete(self, relpath):
485
475
        """Delete the item at relpath"""