diff --git a/convore/api.py b/convore/api.py index 80463f5..16c8861 100644 --- a/convore/api.py +++ b/convore/api.py @@ -20,7 +20,7 @@ import groups API_URL = 'https://convore.com/api/' - +AUTH = None # ======= # Helpers @@ -50,7 +50,7 @@ def get(*path, **kwargs): params = kwargs.get('params', None) - r = requests.get(url, params=params) + r = requests.get(url, params=params, auth=auth) error = kwargs.get('error', None) return _safe_response(r, error) @@ -59,7 +59,7 @@ def get(*path, **kwargs): def post(params, *path): url = '%s%s%s' % (API_URL, '/'.join(map(str, path)), '.json') - r = requests.post(url, params=params) + r = requests.post(url, params=params, auth=auth) return _safe_response(r) @@ -77,9 +77,10 @@ class APIError(RuntimeError): def login(username, password): """Configured API Credentials""" - auth = requests.AuthObject(username, password) - requests.add_autoauth(API_URL, auth) - + global auth + + auth = (username, password) + # print requests.auth_manager.__dict__ # ========== # End Points @@ -120,3 +121,14 @@ class Groups(SyncedList): group.import_from_api(_group) group.joined = True self.data.append(group) + + +class Topics(SyncedList): + + __data_keys__ = [] + + def __init__(self): + pass + + def import_from_api(self, d): + print d diff --git a/reqs.txt b/reqs.txt index cac3bea..8ff5846 100644 --- a/reqs.txt +++ b/reqs.txt @@ -1 +1 @@ -requests=0.2.4 \ No newline at end of file +requests=0.3.0 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 75b026f..6068749 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ commands=py.test --junitxml=junit-{envname}.xml deps = simplejson pytest - requests + requests==0.3.0 [testenv:pypy] basepython=/usr/bin/pypy-c