(test) New JSON payload for contacts list

Results are now an array of arrays instead of an array of dictionaries.
pull/201/head
Francis Lachapelle 2016-02-22 14:16:37 -05:00
parent aab87212d0
commit 31a51ccc83
1 changed files with 6 additions and 2 deletions

View File

@ -71,8 +71,12 @@ class Carddav:
url = "/SOGo/so/%s/Contacts/personal/view" % (self.login)
content = self._get(url)
#print "\nCONTENT:", content
if 'cards' in content:
self.cards = content['cards']
if 'headers' in content:
self.cards = []
fields = content['headers'][0]
for h in content['headers'][1:]:
card = {f: h[i] for i, f in enumerate(fields)}
self.cards.append(card)
else:
self.cards = []
return self.cards