Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/phabricator/lister.py
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | def request_params(self, identifier): | ||||
return {'headers': self.request_headers() or {}, | return {'headers': self.request_headers() or {}, | ||||
'params': {'api.token': api_token}} | 'params': {'api.token': api_token}} | ||||
def request_headers(self): | def request_headers(self): | ||||
""" | """ | ||||
(Override) Set requests headers to send when querying the | (Override) Set requests headers to send when querying the | ||||
Phabricator API | Phabricator API | ||||
""" | """ | ||||
return {'User-Agent': 'Software Heritage phabricator lister', | headers = super().request_headers() | ||||
'Accept': 'application/json'} | headers['Accept'] = 'application/json' | ||||
return headers | |||||
def get_model_from_repo(self, repo): | def get_model_from_repo(self, repo): | ||||
url = get_repo_url(repo['attachments']['uris']['uris']) | url = get_repo_url(repo['attachments']['uris']['uris']) | ||||
if url is None: | if url is None: | ||||
return None | return None | ||||
return { | return { | ||||
'uid': url, | 'uid': url, | ||||
'indexable': repo['id'], | 'indexable': repo['id'], | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |