web /statistics : show 0 instead of None for mutable files
authorBrian Warner <warner@allmydata.com>
Mon, 16 Jun 2008 23:37:04 +0000 (16:37 -0700)
committerBrian Warner <warner@allmydata.com>
Mon, 16 Jun 2008 23:37:04 +0000 (16:37 -0700)
src/allmydata/web/status.py

index 020be4a1a8747c45029835b5592390e7da683b6f..39a3e0f029daddad6d8bd39be30dce3a56e51531 100644 (file)
@@ -961,13 +961,13 @@ class Statistics(rend.Page):
                 (files, bytes, abbreviate_size(bytes)))
 
     def render_publishes(self, ctx, data):
-        files = data["counters"].get("mutable.files_published")
+        files = data["counters"].get("mutable.files_published", 0)
         bytes = data["counters"].get("mutable.bytes_published", 0)
         return "%s files / %s bytes (%s)" % (files, bytes,
                                              abbreviate_size(bytes))
 
     def render_retrieves(self, ctx, data):
-        files = data["counters"].get("mutable.files_retrieved")
+        files = data["counters"].get("mutable.files_retrieved", 0)
         bytes = data["counters"].get("mutable.bytes_retrieved", 0)
         return "%s files / %s bytes (%s)" % (files, bytes,
                                              abbreviate_size(bytes))