diff --git a/convore/groups.py b/convore/groups.py index bba7fbf..a5cddd4 100644 --- a/convore/groups.py +++ b/convore/groups.py @@ -1,8 +1,20 @@ -import json +# -*- coding: utf-8 -*- +""" + convore.groups + ~~~~~~~~~~~ + This module implements the group endpoint sub-wrappers. + + :copyright: (c) 2011 by Kenneth Reitz. + :license: ISC, see LICENSE for more details. +""" import api import models -from types import SyncedList +from convore.packages.anyjson import deserialize +from convore.types import SyncedList + + + class GroupsDiscover(object): @@ -15,7 +27,7 @@ class GroupsDiscover(object): def _discover_group(self, *cats): _groups = [] r = api.get('groups', 'discover', *cats) - for group in json.loads(r.content)['groups']: + for group in deserialize(r.content)['groups']: _group = models.Group() _group.import_from_api(group) _groups.append(_group) @@ -37,7 +49,7 @@ class GroupsDiscoverExplore(object): def _discover_group(self, *cats): _groups = [] r = api.get('groups', 'discover', *cats) - for group in json.loads(r.content)['groups']: + for group in deserialize(r.content)['groups']: _group = models.Group() _group.import_from_api(group) _groups.append(_group) diff --git a/convore/models.py b/convore/models.py index 6b749e8..6346be1 100644 --- a/convore/models.py +++ b/convore/models.py @@ -1,5 +1,19 @@ +# -*- coding: utf-8 -*- +""" + convore.models + ~~~~~~~~~~~~~~ + + This module implements the internal models for + Convore API object storage. + + :copyright: (c) 2011 by Kenneth Reitz. + :license: ISC, see LICENSE for more details. +""" + from datetime import datetime + + class User(object): """Convore User object.""" diff --git a/convore/types.py b/convore/types.py index c4c8340..1a864cf 100644 --- a/convore/types.py +++ b/convore/types.py @@ -3,14 +3,17 @@ convore.types ~~~~~~~~~~~ - This module contains he wrapper objects. + This module contains the reusable helper objects + used throughout the wrapper. :copyright: (c) 2011 by Kenneth Reitz. :license: ISC, see LICENSE for more details. """ + + class SyncedList(object): - """ Synced List datatype. + """Synced List datatype. __data_keys__ are the list of 'primary keys' for item lookup. self.get() needs to be defined.