def get_repos(cls, api, testing=False, level=logging.INFO):
"""
Get the list of repositories
"""
repos = []
nb_repos = 0
query = api.search_code(cls.GITHUB_QUERY)
success_query = False
while not success_query:
try:
for rep in query:
nb_repos += 1
repos.append(rep.html_url)
cls._log.info(
"repo nº{x} :\n{y}".format(x=nb_repos, y=rep.html_url))
success_query = True
except GithubException:
if testing:
success_query = True
else:
print("Hit rate limit, sleeping 60 seconds...")
sleep(60)
continue
repos = {x for x in repos if cls.HISTORY_FILE.search(x)}
return repos
评论列表
文章目录