mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
feat: add progress bar while collecting issues
This commit is contained in:
parent
10fee78ddd
commit
de87418647
1 changed files with 14 additions and 12 deletions
|
@ -24,18 +24,20 @@ headers = {"Authorization": f"token {TOKEN}", "Accept": "application/vnd.github.
|
|||
def get_issues(state="open"):
|
||||
issues = []
|
||||
page = 1
|
||||
while True:
|
||||
response = requests.get(
|
||||
f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues",
|
||||
headers=headers,
|
||||
params={"state": state, "page": page, "per_page": 100},
|
||||
)
|
||||
response.raise_for_status()
|
||||
page_issues = response.json()
|
||||
if not page_issues:
|
||||
break
|
||||
issues.extend(page_issues)
|
||||
page += 1
|
||||
with tqdm(desc="Collecting issues", unit="page") as pbar:
|
||||
while True:
|
||||
response = requests.get(
|
||||
f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues",
|
||||
headers=headers,
|
||||
params={"state": state, "page": page, "per_page": 100},
|
||||
)
|
||||
response.raise_for_status()
|
||||
page_issues = response.json()
|
||||
if not page_issues:
|
||||
break
|
||||
issues.extend(page_issues)
|
||||
page += 1
|
||||
pbar.update(1)
|
||||
return issues
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue