summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
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/imap
parenta8d64317834c4efc56d41b314d0a219e5de7ecfd (diff)
downloadpykolab-b6e86aca4378144c38424f2f796913fd4ac2172c.tar.gz
Fix the utf7 backend versus preferred utf8 display
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 8b7b899..b203db6 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -257,8 +257,14 @@ class IMAP(object):
"""
Obtain all metadata entries on a folder
"""
+ metadata = {}
- return self.imap.getannotation(folder, '*')
+ _metadata = self.imap.getannotation(self.folder_utf7(folder), '*')
+
+ for (k,v) in _metadata.items():
+ metadata[self.folder_utf8(k)] = v
+
+ return metadata
def get_separator(self):
if not hasattr(self, 'imap') or self.imap == None:
@@ -322,7 +328,7 @@ class IMAP(object):
if short_rights.has_key(acl):
acl = short_rights[acl]
- self.imap.sam(folder, identifier, acl)
+ self.imap.sam(self.folder_utf7(folder), identifier, acl)
def set_metadata(self, folder, metadata_path, metadata_value, shared=True):
"""
@@ -639,7 +645,7 @@ class IMAP(object):
Check if the environment has a folder named folder.
"""
folders = self.imap.lm(self.folder_utf7(folder))
- log.debug(_("Looking for folder '%s', we found folders: %r") % (folder,folders), level=8)
+ log.debug(_("Looking for folder '%s', we found folders: %r") % (folder,[self.folder_utf8(x) for x in folders]), level=8)
# Greater then one, this folder may have subfolders.
if len(folders) > 0:
return True
@@ -917,10 +923,10 @@ class IMAP(object):
"""
List the ACL entries on a folder
"""
- return self.imap.lam(folder)
+ return self.imap.lam(self.folder_utf7(folder))
def list_folders(self, pattern):
- return self.lm(self.folder_utf7(pattern))
+ return [self.folder_utf8(x) for x in self.lm(self.folder_utf7(pattern))]
def list_user_folders(self, primary_domain=None, secondary_domains=[]):
"""