~aaron-whitehouse/duplicity/bug_884371_asterisks_in_includes

« back to all changes in this revision

Viewing changes to duplicity/path.py

  • Committer: Kenneth Loafman
  • Date: 2015-01-22 20:04:16 UTC
  • Revision ID: kenneth@loafman.com-20150122200416-k2byfc7hisdklvr3
* Misc fixes for the following PEP8 issues:
  - E127, E128
  - see http://pep8.readthedocs.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        elif stat.S_ISFIFO(st_mode):
84
84
            self.type = "fifo"
85
85
        elif stat.S_ISSOCK(st_mode):
86
 
            raise PathException(util.ufn(self.get_relative_path()) + 
 
86
            raise PathException(util.ufn(self.get_relative_path()) +
87
87
                                u"is a socket, unsupported by tar")
88
88
            self.type = "sock"
89
89
        elif stat.S_ISCHR(st_mode):
162
162
    def open(self, mode):
163
163
        """Return fileobj associated with self"""
164
164
        assert mode == "rb" and self.fileobj and not self.opened, \
165
 
               "%s %s %s" % (mode, self.fileobj, self.opened)
 
165
            "%s %s %s" % (mode, self.fileobj, self.opened)
166
166
        self.opened = 1
167
167
        return self.fileobj
168
168
 
364
364
            log_diff(_("File %s is missing"))
365
365
            return 0
366
366
        if self.type != other.type:
367
 
            log_diff(_("File %%s has type %s, expected %s") % 
 
367
            log_diff(_("File %%s has type %s, expected %s") %
368
368
                     (other.type, self.type))
369
369
            return 0
370
370
 
371
371
        if self.isreg() or self.isdir() or self.isfifo():
372
372
            if not self.perms_equal(other):
373
 
                log_diff(_("File %%s has permissions %s, expected %s") % 
 
373
                log_diff(_("File %%s has permissions %s, expected %s") %
374
374
                         (other.getperms(), self.getperms()))
375
375
                return 0
376
376
            if ((int(self.stat.st_mtime) != int(other.stat.st_mtime)) and
377
377
                    (self.stat.st_mtime > 0 or other.stat.st_mtime > 0)):
378
 
                log_diff(_("File %%s has mtime %s, expected %s") % 
 
378
                log_diff(_("File %%s has mtime %s, expected %s") %
379
379
                         (dup_time.timetopretty(int(other.stat.st_mtime)),
380
380
                          dup_time.timetopretty(int(self.stat.st_mtime))))
381
381
                return 0
391
391
            if self.symtext == other.symtext:
392
392
                return 1
393
393
            else:
394
 
                log_diff(_("Symlink %%s points to %s, expected %s") % 
 
394
                log_diff(_("Symlink %%s points to %s, expected %s") %
395
395
                         (other.symtext, self.symtext))
396
396
                return 0
397
397
        elif self.isdev():
398
398
            if not self.perms_equal(other):
399
 
                log_diff(_("File %%s has permissions %s, expected %s") % 
 
399
                log_diff(_("File %%s has permissions %s, expected %s") %
400
400
                         (other.getperms(), self.getperms()))
401
401
                return 0
402
402
            if self.devnums != other.devnums:
647
647
        global _tmp_path_counter
648
648
        parent_dir = self.get_parent_dir()
649
649
        while 1:
650
 
            temp_path = parent_dir.append("duplicity_temp." + 
 
650
            temp_path = parent_dir.append("duplicity_temp." +
651
651
                                          str(_tmp_path_counter))
652
652
            if not temp_path.type:
653
653
                return temp_path
654
654
            _tmp_path_counter += 1
655
655
            assert _tmp_path_counter < 10000, \
656
 
                   u"Warning too many temp files created for " + util.ufn(self.name)
 
656
                u"Warning too many temp files created for " + util.ufn(self.name)
657
657
 
658
658
    def compare_recursive(self, other, verbose=None):
659
659
        """Compare self to other Path, descending down directories"""