@@ -36,7 +36,7 @@ def authenticate(self):
36
36
'access_token' : os .environ .get ('GITHUB_API_TOKEN' , '' ),
37
37
}
38
38
39
- def fetch (self , url , callback = None , params = None , ** kwargs ):
39
+ def fetch (self , url , params = None , ** kwargs ):
40
40
"""Add GitHub auth to self.client.fetch"""
41
41
if not url .startswith (self .github_api_url ):
42
42
raise ValueError (
@@ -54,7 +54,7 @@ def fetch(self, url, callback=None, params=None, **kwargs):
54
54
headers ['Authorization' ] = 'token ' + self .auth ['access_token' ]
55
55
56
56
url = url_concat (url , params )
57
- future = self .client .fetch (url , callback , ** kwargs )
57
+ future = self .client .fetch (url , ** kwargs )
58
58
future .add_done_callback (self ._log_rate_limit )
59
59
return future
60
60
@@ -99,39 +99,39 @@ def _log_rate_limit(self, future):
99
99
log = app_log .warn
100
100
log ("%i/%i GitHub API requests remaining" , remaining , limit )
101
101
102
- def github_api_request (self , path , callback = None , ** kwargs ):
102
+ def github_api_request (self , path , ** kwargs ):
103
103
"""Make a GitHub API request to URL
104
104
105
105
URL is constructed from url and params, if specified.
106
- callback and **kwargs are passed to client.fetch unmodified.
106
+ **kwargs are passed to client.fetch unmodified.
107
107
"""
108
108
url = url_path_join (self .github_api_url , quote (path ))
109
- return self .fetch (url , callback , ** kwargs )
109
+ return self .fetch (url , ** kwargs )
110
110
111
- def get_gist (self , gist_id , callback = None , ** kwargs ):
111
+ def get_gist (self , gist_id , ** kwargs ):
112
112
"""Get a gist"""
113
113
path = u'gists/{}' .format (gist_id )
114
- return self .github_api_request (path , callback , ** kwargs )
114
+ return self .github_api_request (path , ** kwargs )
115
115
116
- def get_contents (self , user , repo , path , callback = None , ref = None , ** kwargs ):
116
+ def get_contents (self , user , repo , path , ref = None , ** kwargs ):
117
117
"""Make contents API request - either file contents or directory listing"""
118
118
path = u'repos/{user}/{repo}/contents/{path}' .format (** locals ())
119
119
if ref is not None :
120
120
params = kwargs .setdefault ('params' , {})
121
121
params ['ref' ] = ref
122
- return self .github_api_request (path , callback , ** kwargs )
122
+ return self .github_api_request (path , ** kwargs )
123
123
124
- def get_repos (self , user , callback = None , ** kwargs ):
124
+ def get_repos (self , user , ** kwargs ):
125
125
"""List a user's repos"""
126
126
path = u"users/{user}/repos" .format (user = user )
127
- return self .github_api_request (path , callback , ** kwargs )
127
+ return self .github_api_request (path , ** kwargs )
128
128
129
- def get_gists (self , user , callback = None , ** kwargs ):
129
+ def get_gists (self , user , ** kwargs ):
130
130
"""List a user's gists"""
131
131
path = u"users/{user}/gists" .format (user = user )
132
- return self .github_api_request (path , callback , ** kwargs )
132
+ return self .github_api_request (path , ** kwargs )
133
133
134
- def get_tree (self , user , repo , path , ref = 'master' , recursive = False , callback = None , ** kwargs ):
134
+ def get_tree (self , user , repo , path , ref = 'master' , recursive = False , ** kwargs ):
135
135
"""Get a git tree"""
136
136
# only need a recursive fetch if it's not in the top-level dir
137
137
if '/' in path :
@@ -140,18 +140,18 @@ def get_tree(self, user, repo, path, ref='master', recursive=False, callback=Non
140
140
if recursive :
141
141
params = kwargs .setdefault ('params' , {})
142
142
params ['recursive' ] = True
143
- tree = self .github_api_request (path , callback , ** kwargs )
143
+ tree = self .github_api_request (path , ** kwargs )
144
144
return tree
145
145
146
- def get_branches (self , user , repo , callback = None , ** kwargs ):
146
+ def get_branches (self , user , repo , ** kwargs ):
147
147
"""List a repo's branches"""
148
148
path = u"repos/{user}/{repo}/branches" .format (user = user , repo = repo )
149
- return self .github_api_request (path , callback , ** kwargs )
149
+ return self .github_api_request (path , ** kwargs )
150
150
151
- def get_tags (self , user , repo , callback = None , ** kwargs ):
151
+ def get_tags (self , user , repo , ** kwargs ):
152
152
"""List a repo's branches"""
153
153
path = u"repos/{user}/{repo}/tags" .format (user = user , repo = repo )
154
- return self .github_api_request (path , callback , ** kwargs )
154
+ return self .github_api_request (path , ** kwargs )
155
155
156
156
def extract_tree_entry (self , path , tree_response ):
157
157
"""extract a single tree entry from
0 commit comments