summaryrefslogtreecommitdiffstats
path: root/pykolab/cli/cmd_list_quota.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-05 20:22:33 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-05 20:25:16 +0100
commitb6e86aca4378144c38424f2f796913fd4ac2172c (patch)
treef480d275e8caa184213e41ad78f98ba35d20663b /pykolab/cli/cmd_list_quota.py
parenta8d64317834c4efc56d41b314d0a219e5de7ecfd (diff)
downloadpykolab-b6e86aca4378144c38424f2f796913fd4ac2172c.tar.gz
Fix the utf7 backend versus preferred utf8 display
Diffstat (limited to 'pykolab/cli/cmd_list_quota.py')
-rw-r--r--pykolab/cli/cmd_list_quota.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/pykolab/cli/cmd_list_quota.py b/pykolab/cli/cmd_list_quota.py
index 0bb4789..4d3221f 100644
--- a/pykolab/cli/cmd_list_quota.py
+++ b/pykolab/cli/cmd_list_quota.py
@@ -50,7 +50,7 @@ def execute(*args, **kw):
folders = []
- quota_folders = imap.lm(quota_folder)
+ quota_folders = imap.list_folders(quota_folder)
for quota_folder in quota_folders:
try:
(used, quota) = imap.get_quota(quota_folder)
@@ -63,7 +63,10 @@ def execute(*args, **kw):
percentage = round(((float)(used)/(float)(quota)) * 100.0, 1)
print "%d (Used: %d, Percentage: %d)" % (quota, used, percentage)
else:
- print "No quota"
+ if used == None:
+ print "%d (Used: %d, Percentage: %d)" % (quota, 0, 0)
+ else:
+ print "No quota"
except:
try:
(quota_root, used, quota) = imap.get_quota_root(quota_folder)
@@ -76,7 +79,10 @@ def execute(*args, **kw):
percentage = round(((float)(used)/(float)(quota)) * 100.0, 1)
print "%d (Root: %s, Used: %d, Percentage: %d)" % (quota, quota_root, used, percentage)
else:
- print "No quota"
+ if used == None and not quota_root == None:
+ print "%d (Root: %s, Used: %d, Percentage: %d)" % (quota, quota_root, 0, 0)
+ else:
+ print "No quota"
except:
print "Folder: %s" % (quota_folder)
print "No quota root"