From c5addbd8ead1b12903c9f4e19f61d0593a13d1e0 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 27 May 2018 22:17:29 +0000 Subject: [PATCH] Yolo fixes --- .../maintenancePing/maintenancePing.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/scripts/maintenancePing/maintenancePing.py b/app/scripts/maintenancePing/maintenancePing.py index 527e8f4..adfc601 100755 --- a/app/scripts/maintenancePing/maintenancePing.py +++ b/app/scripts/maintenancePing/maintenancePing.py @@ -92,7 +92,9 @@ def add_comment_about_unmaintained_state(repo, issue): comment = { "body": UNMAINTAINED_WARNING } with requests.Session() as s: s.headers.update({"Authorization": "token {}".format(GITHUB_TOKEN)}) - s.post(api_url, json.dumps(comment)) + r = s.post(api_url, json.dumps(comment)) + + return "Added comment %s" % json.loads(r.text)["html_url"] def get_status_and_todo(repo): @@ -170,7 +172,9 @@ def run_todolist(todolist): done = [] - for app, todo in todolist: + for app, todo in todolist.items(): + if todo is None: + continue print("Running todo action for app %s" % app) try: answer = todo(app) @@ -179,6 +183,9 @@ def run_todolist(todolist): continue done.append(answer) + for d in done: + print(d) + def update_community_list(status, workdir): @@ -263,19 +270,18 @@ def create_pull_request(repo, watdo, pr_infos): with requests.Session() as s: s.headers.update({"Authorization": "token {token}".format(token=GITHUB_TOKEN)}) - s.post(api_url, json.dumps(PR)) + r = s.post(api_url, json.dumps(PR)) + + if r.status_code != 200: + print(r.text) + else: + json.loads(r.text)["html_url"] def main(): monitored, maintained, todolist = analyze_apps() - for app, action in todolist.items(): - print("===") - print(app) - print(maintained[app]) - #print(todolist[app]) - run_todolist(todolist) create_pull_request("YunoHost/apps",