[CalendarServer-changes] [545] CalendarServer/branches/caladmin-tool/caladmin/quotas.py

source_changes at macosforge.org source_changes at macosforge.org
Tue Nov 21 16:10:31 PST 2006


Revision: 545
          http://trac.macosforge.org/projects/calendarserver/changeset/545
Author:   dreid at apple.com
Date:     2006-11-21 16:10:30 -0800 (Tue, 21 Nov 2006)

Log Message:
-----------
better quota reporting

Modified Paths:
--------------
    CalendarServer/branches/caladmin-tool/caladmin/quotas.py

Modified: CalendarServer/branches/caladmin-tool/caladmin/quotas.py
===================================================================
--- CalendarServer/branches/caladmin-tool/caladmin/quotas.py	2006-11-22 00:03:02 UTC (rev 544)
+++ CalendarServer/branches/caladmin-tool/caladmin/quotas.py	2006-11-22 00:10:30 UTC (rev 545)
@@ -54,6 +54,7 @@
         self.userQuotaBytes = config.parent.config['UserQuotaBytes']
         self.calendarCollection = config.parent.calendarCollection
         self.principalCollection = config.parent.principalCollection
+        self.formatter = config.parent.formatter
 
     def getQuotaStats(self):
 
@@ -90,12 +91,22 @@
 
                 childAvailable = childQuota - childUsed
 
-                yield (type,
-                       child.basename(),
+                yield (child.basename(),
+                       type,
                        childQuota,
                        childUsed,
                        childAvailable)
     
     def run(self):
+        if not self.config['types']:
+            self.config['types'] = ['users', 'groups', 'resources']
+
+        self.formatter.printRow(['Name',
+                                 'Type',
+                                 'Quota',
+                                 'Used',
+                                 'Available'],
+                                16)
+                               
         for x in self.getQuotaStats():
-            print x
+            self.formatter.printRow(x, 16)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061121/36a10e92/attachment.html


More information about the calendarserver-changes mailing list