Do not use self from a static method :-).

This commit is contained in:
florentx
2010-08-18 17:38:42 +02:00
parent f29e1b6e26
commit d3fe07f2b5
+3 -3
View File
@@ -196,19 +196,19 @@ class Gists(object):
"""Gist API wrapper"""
def __init__(self, username=None, token=None):
# Token-based Authentication is unnecesary, gist api still in alpha
# Token-based Authentication is unnecessary, gist api still in alpha
self._username = username
self._token = token
@staticmethod
def fetch_by_user(name):
"""Return a list of public Gist objects owned by
the given GitHub username"""
the given GitHub username."""
_url = GIST_JSON % 'gists/%s' % name
# Return a list of Gist objects
return [Gist(json=g, username=self._username, token=self._token)
return [Gist(json=g)
for g in json.load(urllib2.urlopen(_url))['gists']]