rpath.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:rdiff-backup 作者: sol1 项目源码 文件源码
def equal_verbose(self, other, check_index = 1,
                      compare_inodes = 0, compare_ownership = 0,
                      compare_acls = 0, compare_eas = 0, compare_win_acls = 0,
                      compare_size = 1, compare_type = 1, verbosity = 2):
        """Like __eq__, but log more information.  Useful when testing"""
        if check_index and self.index != other.index:
            log.Log("Index %s != index %s" % (self.index, other.index),
                    verbosity)
            return None

        for key in self.data.keys(): # compare dicts key by key
            if (key in ('uid', 'gid', 'uname', 'gname') and
                (self.issym() or not compare_ownership)):
                # Don't compare gid/uid for symlinks, or if told not to
                pass
            elif key == 'type' and not compare_type: pass
            elif key == 'atime' and not Globals.preserve_atime: pass
            elif key == 'ctime': pass
            elif key == 'devloc' or key == 'nlink': pass
            elif key == 'size' and (not self.isreg() or not compare_size): pass
            elif key == 'inode' and (not self.isreg() or not compare_inodes):
                pass
            elif key == 'ea' and not compare_eas: pass
            elif key == 'acl' and not compare_acls: pass
            elif key == 'win_acl' and not compare_win_acls: pass
            elif (not other.data.has_key(key) or
                  self.data[key] != other.data[key]):
                if not other.data.has_key(key):
                    log.Log("Second is missing key %s" % (key,), verbosity)
                else: log.Log("Value of %s differs: %s vs %s" %
                              (key, self.data[key], other.data[key]),
                              verbosity)
                return None
        return 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号