]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
current-downloads status: add SI, size, make numsegs 1-based
authorBrian Warner <warner@allmydata.com>
Tue, 26 Feb 2008 22:02:35 +0000 (15:02 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 26 Feb 2008 22:02:35 +0000 (15:02 -0700)
src/allmydata/download.py
src/allmydata/web/status.xhtml

index c4c7ea5db07b97fcabd7971ff50e327803f40bcb..7632f1e0d00a56c3fa6106e7dd20c889cb46a970 100644 (file)
@@ -389,6 +389,9 @@ class FileDownloader:
 
         self._status = s = DownloadStatus()
         s.set_status("Starting")
+        s.set_storage_index(self._storage_index)
+        s.set_size(self._size)
+        s.set_helper(False)
 
         if IConsumer.providedBy(downloadable):
             downloadable.registerProducer(self, True)
@@ -717,7 +720,7 @@ class FileDownloader:
     def _download_segment(self, res, segnum):
         if self._status:
             self._status.set_status("Downloading segment %d of %d" %
-                                    (segnum, self._total_segments))
+                                    (segnum+1, self._total_segments))
         self.log("downloading seg#%d of %d (%d%%)"
                  % (segnum, self._total_segments,
                     100.0 * segnum / self._total_segments))
@@ -798,8 +801,6 @@ class FileDownloader:
 
 
 class LiteralDownloader:
-    implements(IDownloadStatus)
-
     def __init__(self, client, u, downloadable):
         self._uri = IFileURI(u)
         assert isinstance(self._uri, uri.LiteralFileURI)
index 7b331ef0a96031fe7d7a362f8d6c0fe57965f81a..5e4218773bbbe185f6bf596e06bc551408593f7f 100644 (file)
@@ -50,7 +50,7 @@
     <td><n:slot name="progress"/></td>
     <td><n:slot name="status"/></td>
   </tr>
-  <tr n:pattern="empty"><td>No current uploads!</td></tr>
+  <tr n:pattern="empty"><td>No current downloads!</td></tr>
 </table>
 
 <div>Return to the <a href="/">Welcome Page</a></div>