diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2013-05-24 20:54:12 +0200 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2013-05-24 20:54:12 +0200 |
commit | f9c50355bd0be03b80d952325b4fa4d740ad4c19 (patch) | |
tree | 20e194586e058d0ed88df99d45dd0a143b39403b /cyruslib.py | |
parent | aa3ed1c920c3febf6f875b1e34587f26b88de01a (diff) | |
download | pykolab-f9c50355bd0be03b80d952325b4fa4d740ad4c19.tar.gz |
Correct the parsing of the responses for metadata / annotatemore even better
Diffstat (limited to 'cyruslib.py')
-rw-r--r-- | cyruslib.py | 15 |
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: |