-
Notifications
You must be signed in to change notification settings - Fork 176
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
feat: DRY todo done, add .gitignore(python) for this repo #101
Conversation
api = url + "?page=0&per_page=" + str(per_page) | ||
def _get_all_repo_names(self, url, page=1): | ||
per_page = 60 | ||
api = url + f"?page={page}&per_page=" + str(per_page) |
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.
A quick question: the page start is changed from 0
to 1
, start 0
and start1
, have same result(include github and gitee), right?
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.
I think its start 1, start 0 is kind of wrong, because I also found this problem in my other repo
page += 1 | ||
items = response.json() | ||
|
||
return names + self._get_all_repo_names(url, page=page+1) |
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.
nice recursion
Thanks for your contribution, I do some basic test on #102 . It works. The code is LGTM, I think it's ok to merge after the question anwsered. |
But I am not 100% sure, you can test by change the per page, starts from 1 seems to make more sense. |
I search the GitHub API Doc, found it is from 1. see: https://docs.github.com/cn/rest/guides/traversing-with-pagination But not sure for gitee |
ok,both gitee and github note that the start page is |
哈哈,算是修了一个潜在的 bug~ |
Merged, : ) |
Thanks. |
目前贡献者的CI仅跑了flake8,贡献体验不太好,在#103 跟踪一下,用例集成 |
This
PR
completes the TODOhub-mirror-action/hub-mirror/hub.py
Line 94 in 132b206