From 65fe19d9aa8b399ebb932d48b86a3302e2ffe22c Mon Sep 17 00:00:00 2001 From: Markus-Rost Date: Sun, 2 Aug 2020 13:37:25 +0200 Subject: [PATCH] fix indef blocks, enable newusers, minor fixes --- .gitignore | 1 + scripts/configbuilder.py | 2 +- settings.json.example | 2 +- src/rc_formatters.py | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0294839..cf7a3cf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ lastchange.txt /venv/ /lokalize-scripts/ /venvv/ +__pycache__ diff --git a/scripts/configbuilder.py b/scripts/configbuilder.py index dd39f11..f6ec3ff 100644 --- a/scripts/configbuilder.py +++ b/scripts/configbuilder.py @@ -172,7 +172,7 @@ def set_webhook(): settings["webhookURL"] = option return True else: - print("The webhook URL should start with https://discord.com/api/webhooks/, are you sure it's the right URL?") + print("A Discord webhook URL should start with https://discord.com/api/webhooks/, are you sure it's the right URL?") return False def set_wikiname(): diff --git a/settings.json.example b/settings.json.example index 3da5e5f..ba2fd4c 100644 --- a/settings.json.example +++ b/settings.json.example @@ -17,7 +17,7 @@ "embed": "", "compact": "" }, - "ignored": ["external", "newusers/create", "newusers/autocreate", "newusers/create2", "newusers/byemail", "newusers/newusers"], + "ignored": ["external"], "show_updown_messages": true, "overview": false, "overview_time": "00:00", diff --git a/src/rc_formatters.py b/src/rc_formatters.py index 346dff8..e272427 100644 --- a/src/rc_formatters.py +++ b/src/rc_formatters.py @@ -86,7 +86,7 @@ def compact_formatter(action, change, parsed_comment, categories, recent_changes link = link_formatter(create_article_path("Special:Contributions/{user}".format(user=user))) except ValueError: link = link_formatter(create_article_path(change["title"])) - if change["logparams"]["duration"] == "infinite": + if change["logparams"]["duration"] in ["infinite", "infinity"]: block_time = _("for infinity and beyond") else: english_length = re.sub(r"(\d+)", "", change["logparams"][ @@ -507,7 +507,7 @@ def embed_formatter(action, change, parsed_comment, categories, recent_changes): link = create_article_path("Special:Contributions/{user}".format(user=user)) except ValueError: link = create_article_path(change["title"].replace(" ", "_").replace(')', '\)')) - if change["logparams"]["duration"] == "infinite": + if change["logparams"]["duration"] in ["infinite", "infinity"]: block_time = _("for infinity and beyond") else: english_length = re.sub(r"(\d+)", "", change["logparams"]["duration"]) # note that translation won't work for millenia and century yet