Skip to content

Commit

Permalink
tear out the authentication meta option and just add auth passed dire…
Browse files Browse the repository at this point in the history
…ctly to a requests session
  • Loading branch information
dstufft committed Jan 1, 2012
1 parent 7497971 commit 6054be9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions slumber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def __getattr__(self, item):
return Resource(
base_url=url_join(self._meta.base_url, item),
format=self._meta.format,
authentication=self._meta.authentication,
append_slash=self._meta.append_slash,
session=self._session,
)
Expand All @@ -93,7 +92,6 @@ class Resource(ResourceAttributesMixin, MetaMixin, object):
"""

class Meta:
authentication = None
base_url = None
format = "json"
append_slash = True
Expand Down Expand Up @@ -213,16 +211,15 @@ def delete(self, **kwargs):
class API(ResourceAttributesMixin, MetaMixin, object):

class Meta:
authentication = None
base_url = None
format = "json"
append_slash = True

def __init__(self, base_url=None, **kwargs):
def __init__(self, base_url=None, auth=None, **kwargs):
if base_url is not None:
kwargs.update({"base_url": base_url})

self._session = requests.session()
self._session = requests.session(auth=auth)

super(API, self).__init__(**kwargs)

Expand Down

0 comments on commit 6054be9

Please sign in to comment.