From f681a847495e10b3e6f8e2eb71a2f233764ba298 Mon Sep 17 00:00:00 2001 From: esc Date: Thu, 6 Jul 2023 09:47:44 +0200 Subject: [PATCH] address comments from code review As title --- maint/github_weekly_meeting.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/maint/github_weekly_meeting.py b/maint/github_weekly_meeting.py index a5e2237e635..0906479ccb2 100644 --- a/maint/github_weekly_meeting.py +++ b/maint/github_weekly_meeting.py @@ -9,8 +9,7 @@ import github3 -def fetch(target_repo, last_num, gh): - orgname, reponame = target_repo.split('/', 1) +def fetch(orgname, reponame, last_num, gh): repo = gh.repository(orgname, reponame) issues = repo.issues(state='all') @@ -38,15 +37,8 @@ def fetch(target_repo, last_num, gh): # Is Issues where = {'opened': opened_issues, 'closed': closed_issues} - fmt = '- [{}#{}]({}) - {}' - if merged: - fmt = "- merged " + fmt - line = fmt.format( - reponame, - info['number'], - info['html_url'], - info['title'], - ) + line = f"{' - merged ' if merged else ''}- [{reponame}"\ + f"#{info['number']}]({info['html_url']}) - {info['title']}" # Is issue already merged if issue.is_closed(): @@ -90,8 +82,9 @@ def main(numba_last_num, llvmlite_last_num, user=None, password=None): gh = login(str(user), password=str(password)) else: gh = github3 - numba_data = fetch("numba/numba", numba_last_num, gh) - llvmlite_data = fetch("numba/llvmlite", llvmlite_last_num, gh) + + numba_data = fetch("numba", "numba", numba_last_num, gh) + llvmlite_data = fetch("numba", "llvmlite", llvmlite_last_num, gh) # combine data data = {