]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
make current upload/download status objects available from the client
authorBrian Warner <warner@allmydata.com>
Tue, 12 Feb 2008 22:39:45 +0000 (15:39 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 12 Feb 2008 22:39:45 +0000 (15:39 -0700)
src/allmydata/client.py
src/allmydata/download.py
src/allmydata/interfaces.py
src/allmydata/upload.py

index f485a4d572633daf2e81b7f23cf0f5c5e6159113..7314cb6f34fe67260c31e61119b8505602c19769 100644 (file)
@@ -280,3 +280,10 @@ class Client(node.Node, testutil.PollMixin):
         uploader = self.getServiceNamed("uploader")
         return uploader.upload(uploadable)
 
+    def list_uploads(self):
+        uploader = self.getServiceNamed("uploader")
+        return uploader.list_uploads()
+
+    def list_downloads(self):
+        downloader = self.getServiceNamed("downloader")
+        return downloader.list_downloads()
index eb5cd539b2acba6fb3fcd1e6f9ae71cd14d209b3..4d382771aafa41f06161efef74e7f5fcb4c1e53a 100644 (file)
@@ -871,3 +871,5 @@ class Downloader(service.MultiService):
         return self.download(uri, FileHandle(filehandle))
 
 
+    def list_downloads(self):
+        return self._all_downloads.keys()
index f76c674dd434df75636efdf43c601bec51685dc6..986ed4db3fb770bd7ea70836d37da244981b994b 100644 (file)
@@ -1374,6 +1374,14 @@ class IClient(Interface):
                  IDirectoryNode-providing instances, like NewDirectoryNode.
         """
 
+class IClientStatus(Interface):
+    def list_uploads():
+        """Return a list of IUploadStatus objects, one for each
+        upload which is currently running."""
+    def list_downloads():
+        """Return a list of IDownloadStatus objects, one for each
+        download which is currently running."""
+
 class IUploadStatus(Interface):
     def get_storage_index():
         """Return a string with the (binary) storage index in use on this
index 3ea412bc6deae68d5d4fc58dc436674a4c666ee8..af51cd11957181c259d8e3fd092f42a51229e976 100644 (file)
@@ -1167,3 +1167,6 @@ class Uploader(service.MultiService):
             return res
         d.addBoth(_done)
         return d
+
+    def list_uploads(self):
+        return self._all_uploads.keys()