summaryrefslogtreecommitdiffstats
path: root/pykolab/cli/cmd_list_mailbox_metadata.py
diff options
context:
space:
mode:
authorTimotheus Pokorra (TBits.net) <tp@tbits.net>2013-11-21 15:55:16 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-21 15:55:16 +0100
commit0c105fd4f0a1b014e458fb3c09091f1defe72008 (patch)
tree95c4d27a42f1655d9c695baadae8eb937d55be99 /pykolab/cli/cmd_list_mailbox_metadata.py
parent6280ac3c7e5b7209b7b5da7fd0c7d57e7d3744ca (diff)
downloadpykolab-0c105fd4f0a1b014e458fb3c09091f1defe72008.tar.gz
Test if metadata holds the key we're about to use to print the value (#2253)
Diffstat (limited to 'pykolab/cli/cmd_list_mailbox_metadata.py')
-rw-r--r--pykolab/cli/cmd_list_mailbox_metadata.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/pykolab/cli/cmd_list_mailbox_metadata.py b/pykolab/cli/cmd_list_mailbox_metadata.py
index ac98283..e77caea 100644
--- a/pykolab/cli/cmd_list_mailbox_metadata.py
+++ b/pykolab/cli/cmd_list_mailbox_metadata.py
@@ -87,8 +87,9 @@ def execute(*args, **kw):
metadata = imap.get_metadata(folder)
- for annotation in metadata[folder].keys():
- print " %-49s %s" % (
- annotation,
- metadata[folder][annotation]
- )
+ if metadata.has_key(folder):
+ for annotation in metadata[folder].keys():
+ print " %-49s %s" % (
+ annotation,
+ metadata[folder][annotation]
+ )