From c35a6ee3a20e6a8b944781615b86f921c98358e2 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Tue, 6 Jan 2009 08:00:54 -0700 Subject: [PATCH] trivial: fix a bunch of pyflakes complaints --- src/allmydata/immutable/checker.py | 9 ++------- src/allmydata/immutable/filenode.py | 1 - src/allmydata/immutable/repairer.py | 7 +++---- 3 files changed, 5 insertions(+), 12 deletions(-) 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 -- 2.45.2