[CalendarServer-changes] [8269] CalendarServer/trunk/calendarserver/tools/shell.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Nov 9 13:56:59 PST 2011


Revision: 8269
          http://trac.macosforge.org/projects/calendarserver/changeset/8269
Author:   wsanchez at apple.com
Date:     2011-11-09 13:56:58 -0800 (Wed, 09 Nov 2011)
Log Message:
-----------
info on home works

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/shell.py

Modified: CalendarServer/trunk/calendarserver/tools/shell.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/shell.py	2011-11-09 21:11:30 UTC (rev 8268)
+++ CalendarServer/trunk/calendarserver/tools/shell.py	2011-11-09 21:56:58 UTC (rev 8269)
@@ -450,18 +450,30 @@
         self.home = home
 
     def describe(self):
-        return succeed(
-            """Calendar home for UID: %(uid)s\n"""
-            """Quota: %(quotaUsed)s of %(quotaMax)s (%(quotaPercent).2s%%)\n"""
-            % {
-                "uid"          : self.home.uid(),
-                "quotaUsed"    : self.home.quotaUsed(),
-                "quotaMax"     : self.home.quotaAllowedBytes(),
-                "quotaPercent" : self.home.quotaUsed() / self.home.quotaAllowedBytes(),
-            }
-        )
+        d = maybeDeferred(self.home.quotaUsedBytes)
 
+        def gotQuotaUsed(quotaUsed):
+            quotaAllowed = self.home.quotaAllowedBytes()
 
+            return (
+                """Calendar home for UID: %(uid)s\n"""
+                """Quota: %(quotaUsed)s of %(quotaMax)s (%(quotaPercent).2s%%)"""
+                % {
+                    "uid"          : self.home.uid(),
+                    "quotaUsed"    : quotaUsed,
+                    "quotaMax"     : quotaAllowed,
+                    "quotaPercent" : quotaUsed / quotaAllowed,
+                }
+            )
+        d.addCallback(gotQuotaUsed)
+
+        return d
+
+    def list(self):
+        # FIXME
+        return succeed(())
+
+
 def main(argv=sys.argv, stderr=sys.stderr, reactor=None):
     """
     Do the export.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111109/858df0cc/attachment.html>


More information about the calendarserver-changes mailing list