Skip to content

Commit

Permalink
Don't accept arbitrary *args to __call__
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrobenolt committed Sep 29, 2014
1 parent 31a5286 commit 1c6f318
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions disqusapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def __getattr__(self, attr):
pass
return Resource(self.api, interface, attr, self.tree)

def __call__(self, *args, **kwargs):
return self._request(*args, **kwargs)
def __call__(self, endpoint=None, **kwargs):
return self._request(endpoint, **kwargs)

def _request(self, *args, **kwargs):
if args:
def _request(self, endpoint=None, **kwargs):
if endpoint is not None:
# Handle undefined interfaces
resource = self.interfaces.get(args[0], {})
endpoint = args[0].replace('.', '/')
resource = self.interfaces.get(endpoint, {})
endpoint = endpoint.replace('.', '/')
else:
resource = self.interfaces
endpoint = '/'.join(self.tree)
Expand Down

0 comments on commit 1c6f318

Please sign in to comment.