rorpiter.py 文件源码

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

项目:rdiff-backup 作者: sol1 项目源码 文件源码
def __call__(self, *args):
        """Process args, where args[0] is current position in iterator

        Returns true if args successfully processed, false if index is
        not in the current tree and thus the final result is
        available.

        Also note below we set self.index after doing the necessary
        start processing, in case there is a crash in the middle.

        """
        index = args[0]
        if self.index is None:
            self.root_branch.base_index = index
            if self.root_branch.can_fast_process(*args):
                self.root_branch.fast_process(*args)
                self.root_fast_processed = 1
            else: self.root_branch.start_process(*args)
            self.index = index
            return 1
        if index == self.index:
            log.Log("Warning, repeated index %s, bad filesystem?"
                    % (index,), 2)
        elif index < self.index:
            assert 0, "Bad index order: %s >= %s" % (self.index, index)
        else: # normal case
            if self.finish_branches(index) is None:
                return None # We are no longer in the main tree
            last_branch = self.branches[-1]
            if last_branch.can_fast_process(*args):
                last_branch.fast_process(*args)
            else:
                branch = self.add_branch(index)
                branch.start_process(*args)

        self.index = index
        return 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号