]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
mutable: cosmetic changes
authorBrian Warner <warner@allmydata.com>
Mon, 10 Mar 2008 22:44:05 +0000 (15:44 -0700)
committerBrian Warner <warner@allmydata.com>
Mon, 10 Mar 2008 22:44:05 +0000 (15:44 -0700)
src/allmydata/mutable.py
src/allmydata/test/test_mutable.py

index c57e5d695df183268a144d9ba669d91d908b15f9..e6a472273df36ef7c106bdd59827d912dcdf86b5 100644 (file)
@@ -514,10 +514,11 @@ class Retrieve:
     def _got_results_one_share(self, shnum, data, peerid):
         self.log("_got_results: got shnum #%d from peerid %s"
                  % (shnum, idlib.shortnodeid_b2a(peerid)))
+
+        # this might raise NeedMoreDataError, in which case the rest of
+        # the shares are probably short too. _query_failed() will take
+        # responsiblity for re-issuing the queries with a new length.
         (seqnum, root_hash, IV, k, N, segsize, datalength,
-         # this might raise NeedMoreDataError, in which case the rest of
-         # the shares are probably short too. _query_failed() will take
-         # responsiblity for re-issuing the queries with a new length.
          pubkey_s, signature, prefix) = unpack_prefix_and_signature(data)
 
         if not self._pubkey:
@@ -1088,7 +1089,7 @@ class Publish:
         d.addCallback(self._got_all_query_results,
                       total_shares, reachable_peers,
                       current_share_peers)
-        # TODO: add an errback to, probably to ignore that peer
+        # TODO: add an errback too, probably to ignore that peer
 
         # TODO: if we can't get a privkey from these servers, consider
         # looking farther afield. Be aware of the old 0.7.0 behavior that
index 184698364066b452f22cd25255ac8fb9b79c0ae5..32ef820c00a14306164719f400f3d274512755a6 100644 (file)
@@ -141,6 +141,23 @@ class FakeClient:
         d.addCallback(_got_data)
         return d
 
+class FakePubKey:
+    def __init__(self, count):
+        self.count = count
+    def serialize(self):
+        return "PUBKEY-%d" % self.count
+    def verify(self, msg, signature):
+        return True
+
+class FakePrivKey:
+    def __init__(self, count):
+        self.count = count
+    def serialize(self):
+        return "PRIVKEY-%d" % self.count
+    def sign(self, data):
+        return "SIGN(%s)" % data
+
+
 class Filenode(unittest.TestCase):
     def setUp(self):
         self.client = FakeClient()
@@ -396,20 +413,3 @@ class Publish(unittest.TestCase):
             pass
         d.addCallback(_done)
         return d
-
-
-class FakePubKey:
-    def __init__(self, count):
-        self.count = count
-    def serialize(self):
-        return "PUBKEY-%d" % self.count
-    def verify(self, msg, signature):
-        return True
-
-class FakePrivKey:
-    def __init__(self, count):
-        self.count = count
-    def serialize(self):
-        return "PRIVKEY-%d" % self.count
-    def sign(self, data):
-        return "SIGN(%s)" % data