Created
August 15, 2022 07:38
-
-
Save patrikbraborec/0cfeaf8577d2cb4ae88bf73ae4432dd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_pages(self, org: str, repo: str, table: Table): | |
| endpoint = self.get_endpoint(org, repo, table) | |
| self.logger.info(f'get_pages endpoint={endpoint}') | |
| page = 1 | |
| params = self.get_params(page, table) | |
| result = [] | |
| batch = self.rest_api.get(endpoint, params=params).json() | |
| result.extend(batch) | |
| while batch: | |
| self.logger.info(f'get_pages endpoint={endpoint} done={len(result)}') | |
| page += 1 | |
| params = self.get_params(page, table) | |
| batch = self.rest_api.get(endpoint, params=params).json() | |
| result.extend(batch) | |
| return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment