From a5d0c709c65ede96481939034b3e102ef1930e07 Mon Sep 17 00:00:00 2001 From: Frisk Date: Mon, 19 Apr 2021 01:21:38 +0200 Subject: [PATCH] Updated license notices, some whitespace changes --- src/configloader.py | 15 +++++++++++++++ src/discord/message.py | 15 +++++++++++++++ src/discord/queue.py | 15 +++++++++++++++ src/discord/redaction.py | 15 +++++++++++++++ src/discussion_formatters.py | 15 +++++++++++++++ src/discussions.py | 9 ++++----- src/exceptions.py | 15 +++++++++++++++ src/fileio/database.py | 15 +++++++++++++++ src/i18n.py | 15 +++++++++++++++ src/misc.py | 9 ++++----- src/rc.py | 17 +++++++++++++++++ src/rc_formatters.py | 17 +++++++++++++++++ src/rcgcdw.py | 17 ++++++++--------- src/session.py | 9 ++++----- 14 files changed, 174 insertions(+), 24 deletions(-) diff --git a/src/configloader.py b/src/configloader.py index 5bd7467..3b09549 100644 --- a/src/configloader.py +++ b/src/configloader.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import json import logging import sys diff --git a/src/discord/message.py b/src/discord/message.py index dac9cae..8ac1f72 100644 --- a/src/discord/message.py +++ b/src/discord/message.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import json import math import random diff --git a/src/discord/queue.py b/src/discord/queue.py index 07f28af..9777287 100644 --- a/src/discord/queue.py +++ b/src/discord/queue.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import re import sys import time diff --git a/src/discord/redaction.py b/src/discord/redaction.py index ffe2f69..6fa86ba 100644 --- a/src/discord/redaction.py +++ b/src/discord/redaction.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import logging import json from src.configloader import settings diff --git a/src/discussion_formatters.py b/src/discussion_formatters.py index 6b8b624..ac015a0 100644 --- a/src/discussion_formatters.py +++ b/src/discussion_formatters.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import datetime, logging import json import gettext diff --git a/src/discussions.py b/src/discussions.py index 5793502..25e3036 100644 --- a/src/discussions.py +++ b/src/discussions.py @@ -1,20 +1,19 @@ # -*- coding: utf-8 -*- -# Recent changes Goat compatible Discord webhook is a project for using a webhook as recent changes page from MediaWiki. -# Copyright (C) 2020 Frisk +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). -# This program is free software: you can redistribute it and/or modify +# RcGcDw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# This program is distributed in the hope that it will be useful, +# RcGcDw is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with RcGcDw. If not, see . import logging, schedule, requests from typing import Dict, Any diff --git a/src/exceptions.py b/src/exceptions.py index 620f134..8b25c64 100644 --- a/src/exceptions.py +++ b/src/exceptions.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + class MWError(Exception): pass diff --git a/src/fileio/database.py b/src/fileio/database.py index b924902..ea78fba 100644 --- a/src/fileio/database.py +++ b/src/fileio/database.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import sqlite3 import logging import json diff --git a/src/i18n.py b/src/i18n.py index 1f43c4c..116a754 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -1,3 +1,18 @@ +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import gettext, sys, logging from src.configloader import settings logger = logging.getLogger("rcgcdw.i18n") diff --git a/src/misc.py b/src/misc.py index f241806..f0d90bb 100644 --- a/src/misc.py +++ b/src/misc.py @@ -1,20 +1,19 @@ # -*- coding: utf-8 -*- -# Recent changes Goat compatible Discord webhook is a project for using a webhook as recent changes page from MediaWiki. -# Copyright (C) 2018 Frisk +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). -# This program is free software: you can redistribute it and/or modify +# RcGcDw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# This program is distributed in the hope that it will be useful, +# RcGcDw is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with RcGcDw. If not, see . import base64 import json, logging, sys, re from html.parser import HTMLParser diff --git a/src/rc.py b/src/rc.py index 2accac9..7779269 100644 --- a/src/rc.py +++ b/src/rc.py @@ -1,3 +1,20 @@ +# -*- coding: utf-8 -*- + +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import re import sys import time diff --git a/src/rc_formatters.py b/src/rc_formatters.py index 662e61b..610e24b 100644 --- a/src/rc_formatters.py +++ b/src/rc_formatters.py @@ -1,3 +1,20 @@ +# -*- coding: utf-8 -*- + +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). + +# RcGcDw is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# RcGcDw is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with RcGcDw. If not, see . + import ipaddress import math import re diff --git a/src/rcgcdw.py b/src/rcgcdw.py index 2bd33e5..9f988e8 100644 --- a/src/rcgcdw.py +++ b/src/rcgcdw.py @@ -1,21 +1,20 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Recent changes Goat compatible Discord webhook is a project for using a webhook as recent changes page from MediaWiki. -# Copyright (C) 2018 Frisk +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). -# This program is free software: you can redistribute it and/or modify +# RcGcDw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# This program is distributed in the hope that it will be useful, +# RcGcDw is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with RcGcDw. If not, see . # WARNING! SHITTY CODE AHEAD. ENTER ONLY IF YOU ARE SURE YOU CAN TAKE IT # You have been warned @@ -82,7 +81,7 @@ def day_overview_request(): recent_changes.downtime_controller(True) complete = 2 except KeyError: - logger.warning("Wiki returned %s" % (request)) + logger.warning("Wiki returned %s" % request) complete = 2 except MWError: complete = 2 @@ -131,6 +130,7 @@ def daily_overview_sync(edits, files, admin, changed_bytes, new_articles, unique datafile.save_datafile() return edits, files, admin, changed_bytes, new_articles, unique_contributors, day_score + def day_overview(): result = day_overview_request() if result[1] == 1: @@ -207,7 +207,6 @@ def day_overview(): logger.debug("function requesting changes for day overview returned with error code") - # Log in and download wiki information try: if settings["wiki_bot_login"] and settings["wiki_bot_password"]: @@ -239,7 +238,7 @@ if settings["rc_enabled"]: else: logger.info("Script started! RC is disabled however, this means no recent changes will be sent :c") -if 1 == 2: # additional translation strings in unreachable code +if 1 == 2: # additional translation strings in unreachable code print(_("director"), _("bot"), _("editor"), _("directors"), _("sysop"), _("bureaucrat"), _("reviewer"), _("autoreview"), _("autopatrol"), _("wiki_guardian"), ngettext("second", "seconds", 1), ngettext("minute", "minutes", 1), ngettext("hour", "hours", 1), ngettext("day", "days", 1), ngettext("week", "weeks", 1), ngettext("month", "months",1), ngettext("year", "years", 1), ngettext("millennium", "millennia", 1), ngettext("decade", "decades", 1), ngettext("century", "centuries", 1)) # noinspection PyUnreachableCode @@ -254,6 +253,6 @@ if TESTING: src.discussions.fetch_discussions() sys.exit(0) -while 1: +while 1: time.sleep(1.0) schedule.run_pending() diff --git a/src/session.py b/src/session.py index d5cd81d..3db940a 100644 --- a/src/session.py +++ b/src/session.py @@ -1,20 +1,19 @@ # -*- coding: utf-8 -*- -# Recent changes Goat compatible Discord webhook is a project for using a webhook as recent changes page from MediaWiki. -# Copyright (C) 2020 Frisk +# This file is part of Recent changes Goat compatible Discord webhook (RcGcDw). -# This program is free software: you can redistribute it and/or modify +# RcGcDw is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# This program is distributed in the hope that it will be useful, +# RcGcDw is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with RcGcDw. If not, see . import requests from src.configloader import settings