From: Zooko O'Whielacronx Date: Tue, 6 Jan 2009 15:00:54 +0000 (-0700) Subject: trivial: fix a bunch of pyflakes complaints X-Git-Url: https://git.rkrishnan.org/frontends//%22%22.?a=commitdiff_plain;h=c35a6ee3a20e6a8b944781615b86f921c98358e2;p=tahoe-lafs%2Ftahoe-lafs.git trivial: fix a bunch of pyflakes complaints --- diff --git a/src/allmydata/immutable/checker.py b/src/allmydata/immutable/checker.py index 5a2d980e..bcccd8a9 100644 --- a/src/allmydata/immutable/checker.py +++ b/src/allmydata/immutable/checker.py @@ -1,18 +1,13 @@ -from twisted.internet import defer -from twisted.python import failure from foolscap import DeadReferenceError -from allmydata import hashtree, storage +from allmydata import hashtree from allmydata.checker_results import CheckerResults from allmydata.immutable import download from allmydata.uri import CHKFileVerifierURI from allmydata.util.assertutil import precondition -from allmydata.util import base32, deferredutil, hashutil, log, nummedobj, rrefutil +from allmydata.util import base32, deferredutil, log, rrefutil from allmydata.immutable import layout -def _permute_servers(servers, key): - return sorted(servers, key=lambda x: sha.new(key+x[0]).digest()) - class Checker(log.PrefixingLogMixin): """ I query all servers to see if M uniquely-numbered shares are available. diff --git a/src/allmydata/immutable/filenode.py b/src/allmydata/immutable/filenode.py index 474990a4..e8e9d96b 100644 --- a/src/allmydata/immutable/filenode.py +++ b/src/allmydata/immutable/filenode.py @@ -9,7 +9,6 @@ from foolscap.eventual import eventually from allmydata.interfaces import IFileNode, IFileURI, ICheckable, \ IDownloadTarget from allmydata.util import log, base32 -from allmydata.uri import from_string as uri_from_string from allmydata.immutable.checker import Checker from allmydata.checker_results import CheckAndRepairResults from allmydata.immutable.repairer import Repairer diff --git a/src/allmydata/immutable/repairer.py b/src/allmydata/immutable/repairer.py index 2b793485..4f0e3f79 100644 --- a/src/allmydata/immutable/repairer.py +++ b/src/allmydata/immutable/repairer.py @@ -1,15 +1,14 @@ from twisted.internet import defer -from twisted.python import failure from allmydata import storage from allmydata.checker_results import CheckerResults, CheckAndRepairResults from allmydata.immutable import download -from allmydata.util import base32, hashutil, log, nummedobj +from allmydata.util import nummedobj from allmydata.util.assertutil import precondition from allmydata.uri import CHKFileVerifierURI from allmydata.immutable import layout -import sha +import sha, time def _permute_servers(servers, key): return sorted(servers, key=lambda x: sha.new(key+x[0]).digest()) @@ -144,7 +143,7 @@ class Repairer(LogMixin): self._results.timings["peer_selection"] = now - self._started if len(self._share_buckets) < self._num_needed_shares: - raise NotEnoughSharesError + raise download.NotEnoughSharesError def _verify_done(self, ignored): # TODO: The following results are just stubs, and need to be replaced