summaryrefslogtreecommitdiffstats
path: root/cyruslib.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-24 20:54:12 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-24 20:54:12 +0200
commitf9c50355bd0be03b80d952325b4fa4d740ad4c19 (patch)
tree20e194586e058d0ed88df99d45dd0a143b39403b /cyruslib.py
parentaa3ed1c920c3febf6f875b1e34587f26b88de01a (diff)
downloadpykolab-f9c50355bd0be03b80d952325b4fa4d740ad4c19.tar.gz
Correct the parsing of the responses for metadata / annotatemore even better
Diffstat (limited to 'cyruslib.py')
-rw-r--r--cyruslib.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/cyruslib.py b/cyruslib.py
index b144156..85d7e63 100644
--- a/cyruslib.py
+++ b/cyruslib.py
@@ -673,15 +673,20 @@ class CYRUS:
continue
for annotation in annotations:
- folder = annotation.split('"')[1].replace('"','')
+ annotation = annotation.strip()
+
+ if not annotation[0] == '"':
+ folder = annotation.split('"')[0].replace('"','').strip()
+ key = annotation.split('"')[1].replace('"','').replace("'","").strip()
+ _annot = annotation.split('(')[1].split(')')[0].strip()
+ else:
+ folder = annotation.split('"')[1].replace('"','').strip()
+ key = annotation.split('"')[3].replace('"','').replace("'","").strip()
+ _annot = annotation.split('(')[1].split(')')[0].strip()
if not ann.has_key(folder):
ann[folder] = {}
- key = annotation.split('"')[3].replace('"','').replace("'","")
-
- _annot = annotation.split('(')[1].split(')')[0]
-
try:
value_priv = _annot[(_annot.index('"value.priv"')+len('"value.priv"')):_annot.index('"size.priv"')].strip()
except ValueError, errmsg: