mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14: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"):
|
def get_issues(state="open"):
|
||||||
issues = []
|
issues = []
|
||||||
page = 1
|
page = 1
|
||||||
while True:
|
with tqdm(desc="Collecting issues", unit="page") as pbar:
|
||||||
response = requests.get(
|
while True:
|
||||||
f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues",
|
response = requests.get(
|
||||||
headers=headers,
|
f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues",
|
||||||
params={"state": state, "page": page, "per_page": 100},
|
headers=headers,
|
||||||
)
|
params={"state": state, "page": page, "per_page": 100},
|
||||||
response.raise_for_status()
|
)
|
||||||
page_issues = response.json()
|
response.raise_for_status()
|
||||||
if not page_issues:
|
page_issues = response.json()
|
||||||
break
|
if not page_issues:
|
||||||
issues.extend(page_issues)
|
break
|
||||||
page += 1
|
issues.extend(page_issues)
|
||||||
|
page += 1
|
||||||
|
pbar.update(1)
|
||||||
return issues
|
return issues
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue