-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added flag -c contributors logging #58
base: master
Are you sure you want to change the base?
Conversation
contributor_name = contributor["author"]["login"] | ||
total_commits = contributor["total"] | ||
total_commits_dict[contributor_name] = total_commits | ||
return total_commits_dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
добавить пустую строку
if args.export_google_sheets: | ||
export_sheets.write_data_to_table(csv_name, args.google_token, args.table_id, args.sheet_id) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а тут убрать
@@ -30,7 +30,10 @@ python3 main.py --invites [-t, --token] token (github токен вместо to | |||
```commandline | |||
python3 main.py [-w, --wikis] [-t, --token] token (github токен вместо token) [-l, --list] list (list - строка пути к txt файлу со списком репозиториев) --dowland_repos path_drepo (path_drepo - строка пути к директории, где сохраняются вики-репозитории) [-o, --out] out (out - название csv файла, в который будут помещены все логи) | |||
``` | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может тут вернуть?
EMPTY_FIELD = 'Empty field' | ||
TIMEDELTA = 0.05 | ||
TIMEZONE = 'Europe/Moscow' | ||
FIELDNAMES = ('repository name', 'login', 'name', 'email', 'url', 'permissions', 'total_commits', 'id', 'node_id', 'type', 'bio', 'site_admin') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в другом ПРе выносится это в отдельный файлик
главное потом не забыть вынести)
info_tmp = { | ||
'repository name': repository.full_name, | ||
'login': contributor.login, | ||
'name': nvl(contributor.name), | ||
'email': nvl(contributor.email), | ||
'url': contributor.html_url, | ||
'permissions': nvl(contributor_permissons), | ||
'total_commits': contributor_total_commits, | ||
'id': contributor.id, | ||
'node_id': contributor.node_id, | ||
'type': contributor.type, | ||
'bio': nvl(contributor.bio), | ||
'site_admin': contributor.site_admin, | ||
} | ||
log_contributors_to_csv(info_tmp, csv_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
и такой подход планируется заменить на датаклассы
#54
while request.status_code == 202: | ||
print("Waiting for response...") | ||
sleep(10) | ||
request = requests.get(request_name, headers=headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А что за код 202? почему мы его ретраим?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется лучше сделать какой-то порог по количеству ретраев и если не получилось за условные 5 попыток, то падать
Вечно ждать никто не будет :(
#35
На всякий случай припасу способ, которым воспользовался. Ветку сломать дело несложное, но нужно впредь будет самому всё починить :)