summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-08-09 13:39:24 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-08-09 13:39:24 +0100
commit35775e2b6ab5be8ba4fd583cd30b11d20a6a18b8 (patch)
tree7866351a2d4cd2ae83274e17a98542935cb8e1df /pykolab
parent2e3f4492c4ee9197b8f4e62e07a57bb94501fc00 (diff)
downloadpykolab-35775e2b6ab5be8ba4fd583cd30b11d20a6a18b8.tar.gz
Add --raw to list-user-subscriptions to allow displaying the folder names in raw utf-7
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/cli/cmd_list_user_subscriptions.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/pykolab/cli/cmd_list_user_subscriptions.py b/pykolab/cli/cmd_list_user_subscriptions.py
index 7e4fe8d..3360613 100644
--- a/pykolab/cli/cmd_list_user_subscriptions.py
+++ b/pykolab/cli/cmd_list_user_subscriptions.py
@@ -21,6 +21,7 @@ import commands
import pykolab
+from pykolab import imap_utf7
from pykolab.imap import IMAP
from pykolab.translate import _
from pykolab import utils
@@ -33,6 +34,12 @@ def __init__():
def cli_options(*args, **kw):
my_option_group = conf.add_cli_parser_option_group(_("CLI Options"))
+ my_option_group.add_option( '--raw',
+ dest = "raw",
+ action = "store_true",
+ default = False,
+ help = _("Display raw IMAP UTF-7 folder names"))
+
my_option_group.add_option( '--unsubscribed',
dest = "unsubscribed",
action = "store_true",
@@ -83,9 +90,15 @@ def execute(*args, **kw):
unsubscribed_folders.append(folder)
if len(unsubscribed_folders) > 0:
- print "\n".join(unsubscribed_folders)
+ if not conf.raw:
+ print "\n".join([imap_utf7.decode(x) for x in unsubscribed_folders])
+ else:
+ print "\n".join(unsubscribed_folders)
else:
print _("No unsubscribed folders for user %s") % (user)
else:
- print "\n".join(subscribed_folders)
+ if not conf.raw:
+ print "\n".join([imap_utf7.decode(x) for x in subscribed_folders])
+ else:
+ print "\n".join(subscribed_folders)