more #514: pass a Monitor to all checker operations, make mutable-checker honor the cancel flag

This commit is contained in:
Brian Warner
2008-10-22 01:38:18 -07:00
parent 8178b10ef1
commit 977c6ac510
14 changed files with 106 additions and 107 deletions

View File

@ -224,11 +224,11 @@ class NewDirectoryNode:
def get_storage_index(self):
return self._uri._filenode_uri.storage_index
def check(self, verify=False):
def check(self, monitor, verify=False):
"""Perform a file check. See IChecker.check for details."""
return self._node.check(verify)
def check_and_repair(self, verify=False):
return self._node.check_and_repair(verify)
return self._node.check(monitor, verify)
def check_and_repair(self, monitor, verify=False):
return self._node.check_and_repair(monitor, verify)
def list(self):
"""I return a Deferred that fires with a dictionary mapping child
@ -669,10 +669,10 @@ class DeepChecker:
def add_node(self, node, childpath):
if self._repair:
d = node.check_and_repair(self._verify)
d = node.check_and_repair(self.monitor, self._verify)
d.addCallback(self._results.add_check_and_repair, childpath)
else:
d = node.check(self._verify)
d = node.check(self.monitor, self._verify)
d.addCallback(self._results.add_check, childpath)
d.addCallback(lambda ignored: self._stats.add_node(node, childpath))
return d