]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/client.py
mutable WIP: clean up status handling, shrink the code a lot, improve test coverage
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / client.py
index f3b9c599c949a108f7d3b2717b511a0c40e68811..e21ed6ff972ade0bd05bd9099afde7719dd58eb8 100644 (file)
@@ -329,7 +329,8 @@ class Client(node.Node, testutil.PollMixin):
             d.addCallback(make_key_objs)
             return d
         else:
-            # RSA key generation for a 2048 bit key takes between 0.8 and 3.2 secs
+            # RSA key generation for a 2048 bit key takes between 0.8 and 3.2
+            # secs
             signer = rsa.generate(key_size)
             verifier = signer.get_verifying_key()
             return verifier, signer
@@ -339,66 +340,28 @@ class Client(node.Node, testutil.PollMixin):
         return uploader.upload(uploadable)
 
 
-    def list_all_uploads(self):
+    def list_all_upload_statuses(self):
         uploader = self.getServiceNamed("uploader")
-        return uploader.list_all_uploads()
-    def list_active_uploads(self):
-        uploader = self.getServiceNamed("uploader")
-        return uploader.list_active_uploads()
-    def list_recent_uploads(self):
-        uploader = self.getServiceNamed("uploader")
-        return uploader.list_recent_uploads()
+        return uploader.list_all_upload_statuses()
 
-    def list_all_downloads(self):
-        downloader = self.getServiceNamed("downloader")
-        return downloader.list_all_downloads()
-    def list_active_downloads(self):
-        downloader = self.getServiceNamed("downloader")
-        return downloader.list_active_downloads()
-    def list_recent_downloads(self):
+    def list_all_download_statuses(self):
         downloader = self.getServiceNamed("downloader")
-        return downloader.list_recent_downloads()
-
-    def list_all_mapupdate(self):
-        watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_all_mapupdate()
-    def list_active_mapupdate(self):
-        watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_active_mapupdate()
-    def list_recent_mapupdate(self):
-        watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_recent_mapupdate()
+        return downloader.list_all_download_statuses()
 
-    def list_all_publish(self):
+    def list_all_mapupdate_statuses(self):
         watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_all_publish()
-    def list_active_publish(self):
+        return watcher.list_all_mapupdate_statuses()
+    def list_all_publish_statuses(self):
         watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_active_publish()
-    def list_recent_publish(self):
+        return watcher.list_all_publish_statuses()
+    def list_all_retrieve_statuses(self):
         watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_recent_publish()
+        return watcher.list_all_retrieve_statuses()
 
-    def list_all_retrieve(self):
-        watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_all_retrieve()
-    def list_active_retrieve(self):
-        watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_active_retrieve()
-    def list_recent_retrieve(self):
-        watcher = self.getServiceNamed("mutable-watcher")
-        return watcher.list_recent_retrieve()
-
-    def list_active_helper_statuses(self):
-        try:
-            helper = self.getServiceNamed("helper")
-        except KeyError:
-            return []
-        return helper.get_active_upload_statuses()
-    def list_recent_helper_statuses(self):
+    def list_all_helper_statuses(self):
         try:
             helper = self.getServiceNamed("helper")
         except KeyError:
             return []
-        return helper.get_recent_upload_statuses()
+        return helper.get_all_upload_statuses()