mirror of
https://github.com/kennethreitz-archive/python-convore.git
synced 2026-06-05 15:30:18 +00:00
Anyjson, docstrings
This commit is contained in:
+16
-4
@@ -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)
|
||||
|
||||
@@ -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."""
|
||||
|
||||
|
||||
+5
-2
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user