Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thehighestmath
Copy link
Collaborator

@thehighestmath thehighestmath commented Sep 23, 2024

#35

На всякий случай припасу способ, которым воспользовался. Ветку сломать дело несложное, но нужно впредь будет самому всё починить :)

git checkout master
git pull
git diff 5f3028e2109533ebfd138b97d4e4a9f85fdf8a4e..dfb71f0b2f9d9c2059c1601a1b528357bc4181ef > ../temp-diff.diff
git apply ../temp-diff.diff
git checkout -b print_contributors-fixed
git add .
git commit -m 'added flag -c contributors logging'
git push

@thehighestmath
Copy link
Collaborator Author

@DaniilLutfulin

contributor_name = contributor["author"]["login"]
total_commits = contributor["total"]
total_commits_dict[contributor_name] = total_commits
return total_commits_dict
Copy link
Collaborator Author

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()

Copy link
Collaborator Author

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 файла, в который будут помещены все логи)
```

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может тут вернуть?

Comment on lines +6 to +9
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')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в другом ПРе выносится это в отдельный файлик
главное потом не забыть вынести)

Comment on lines +27 to +41
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)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и такой подход планируется заменить на датаклассы
#54

Comment on lines +67 to +70
while request.status_code == 202:
print("Waiting for response...")
sleep(10)
request = requests.get(request_name, headers=headers)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А что за код 202? почему мы его ретраим?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется лучше сделать какой-то порог по количеству ретраев и если не получилось за условные 5 попыток, то падать
Вечно ждать никто не будет :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Режим -c - вывод списка контрибьюторов
1 participant