summaryrefslogtreecommitdiff
path: root/larch
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-11-17 19:16:02 +0000
committerLars Wirzenius <liw@liw.fi>2012-11-17 19:16:02 +0000
commit242960096014adcc7823e98ff14b9b752848cc38 (patch)
tree958c22b224e8c42b6588ab060c8f829e45dd6d5f /larch
parent7ae3886f48c31ee95957cf984accaa955af2831c (diff)
downloadlarch-242960096014adcc7823e98ff14b9b752848cc38.tar.gz
Return each work item as created, instead of list
This makes it possible to do smoother progress reporting.
Diffstat (limited to 'larch')
-rwxr-xr-xlarch/fsck.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/larch/fsck.py b/larch/fsck.py
index 3a633fb..3554d95 100755
--- a/larch/fsck.py
+++ b/larch/fsck.py
@@ -220,18 +220,17 @@ class Fsck(object):
self.warning = warning
self.error = error
self.fix = fix
- self.work = []
def find_work(self):
for node_id in self.forest.node_store.list_nodes():
tracing.trace('found node %s' % node_id)
- self.work.append(CheckNode(self, node_id))
+ yield CheckNode(self, node_id)
for tree in self.forest.trees:
- self.work.append(CheckRoot(self, tree.root.id))
+ yield CheckRoot(self, tree.root.id)
extra = CheckExtraNodes(self)
for tree in self.forest.trees:
- self.work.append(CheckRecursively(self, tree.root.id, extra.seen))
- self.work.append(extra)
+ yield CheckRecursively(self, tree.root.id, extra.seen)
+ yield extra
if self.fix:
- self.work.append(CommitForest(self))
+ yield CommitForest(self)