def update(gh, repo): r = uri_to_repo(gh, repo) iss = None for issue in r.iter_issues(since="2016-01-07T00:00:00Z"): if issue.title == "Relicense under dual MIT/Apache-2.0": iss = issue if iss is None or iss.is_closed(): return agreed = [] for comment in iss.iter_comments(): if any(text in comment.body.lower() for text in considered_agreed): agreed.append(comment.user.login) new_text = iss.body for u in agreed: print("{} agreed".format(u)) new_text = new_text.replace("[ ] @{}".format(u), "[x] @{}".format(u)) iss.edit(body=new_text) if "[ ]" in new_text: return False return True
def find_issue(gh, repo): r = uri_to_repo(gh, repo) for issue in r.iter_issues(since="2016-01-07T00:00:00Z"): if issue.title == "Relicense under dual MIT/Apache-2.0": return issue