User:IngenuityBot/backlogdrive.py: Difference between revisions

Content deleted Content added
m Protected "User:IngenuityBot/backlogdrive.py": User request within own user space ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
update
 
(One intermediate revision by the same user not shown)
Line 82:
 
# check each edit to see if it is a review
if re.match(r"Declining(.+?)\(\[\[WP:AFCH\|AFCH\]\] 0\.9\.1\)", edit["comment"]):
review["type"] = "decline"
review["reasons"] = get_review_reasons(edit["comment"])
elif re.match(r"Rejecting(.+?)\(\[\[WP:AFCH\|AFCH\]\] 0\.9\.1\)", edit["comment"]):
review["type"] = "reject"
review["reasons"] = get_review_reasons(edit["comment"])
elif re.match(r"Cleaning up accepted.+?\(\[\[WP:AFCH\|AFCH\]\] 0\.9\.1\)", edit["comment"]):
review["type"] = "accept"
 
Line 153:
# also subtract failed and invalid re-reviews
user_statistics = {}
 
for user in users:
user_statistics[user] = {
Line 167 ⟶ 166:
}
 
for user in users:
content = requests.get(query_url({
"action": "query",
Line 224:
continue
 
iffor review_user[-1]u in user_statistics:
user_statistics[if u.lower() == review_user[-1]]["rereviews"] += 1.lower():
user_statistics[u]["rereviews"] += 1
break
except:
pass
Line 233 ⟶ 235:
for user in user_statistics:
user_statistics[user]["score"] += user_statistics[user]["rereviews"]
 
 
# create table with statistics