Title: Pagination support for lists by twidi · Pull Request #66 · ask/python-github2 · GitHub
Open Graph Title: Pagination support for lists by twidi · Pull Request #66 · ask/python-github2
X Title: Pagination support for lists by twidi · Pull Request #66 · ask/python-github2
Description: For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request. There is no easy way with the current code to know how much pages exist for a given list, so it's up to the user to manage the number of pages to retrieve. In my code i do something like this: # store all data from all pages result = [] # start with page one page = 1 # we don't know yet the max length of a page max_length = 0 while True: # get data for the current page page_result = github.repos.watching(username, page=page) # no result ? it's the end if not page_result: break # save the result result += page_result # check length of result l_page = len(page_result) # if smaller than max, it's the last page if l_page < max_length: break # if bigger, it's the new max if l_page > max_length: max_length = l_page # go next page page += 1 return result
Open Graph Description: For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request....
X Description: For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request....
Opengraph URL: https://github.com/ask/python-github2/pull/66
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:e540985c-3370-5793-0aea-5b432088e16e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D35A:2A7CC:2408ACD:302EE3D:69741519 |
| html-safe-nonce | 0cf04c001961438d802feaaa242c90ab5d1910de112a0e1686a5ab66019caf82 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzVBOjJBN0NDOjI0MDhBQ0Q6MzAyRUUzRDo2OTc0MTUxOSIsInZpc2l0b3JfaWQiOiIyMjU0MTAyMTE5Nzg4NTgyMTcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 77e166c4f814a893dcb9803fde65eed5b750b4c4a2e6cfba3144482cce58d54d |
| hovercard-subject-tag | pull_request:409465 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/ask/python-github2/pull/66/files |
| twitter:image | https://avatars.githubusercontent.com/u/193474?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/193474?s=400&v=4 |
| og:image:alt | For each method asking github for a list, i added a page parameter, default to None. The get_values method catch this paramter and then create (or update) a post_data paramter sent to make_request.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 447dc9917c3d68d647a01abfdefe55ec7ee1785922136c1d8395dbb3ab6d57b9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/ask/python-github2 git https://github.com/ask/python-github2.git |
| octolytics-dimension-user_id | 1558 |
| octolytics-dimension-user_login | ask |
| octolytics-dimension-repository_id | 179358 |
| octolytics-dimension-repository_nwo | ask/python-github2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 179358 |
| octolytics-dimension-repository_network_root_nwo | ask/python-github2 |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8dad7bdfecbe3eaa97ac4e632d6b47e2b23e81d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width