From 7470a157e9056b075ddc09b6a040254f5651b738 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 6 Oct 2023 15:59:34 +0200 Subject: [PATCH] Continued: - added some debug messages - formatted command - added alias 'hajkey' as 'misskey' alias --- fba/boot.py | 8 +++++++- fba/database.py | 2 ++ fba/helpers/software.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/fba/boot.py b/fba/boot.py index 6b90614..a79e428 100644 --- a/fba/boot.py +++ b/fba/boot.py @@ -40,7 +40,13 @@ def init_parser(): ) # Generic: - _PARSER.add_argument("--debug", action="store_const", dest="log_level", const=logging.DEBUG, help="Full debug output") + _PARSER.add_argument( + "--debug", + action="store_const", + dest="log_level", + const=logging.DEBUG, + help="Full debug output" + ) # Commands: subparser_command = _PARSER.add_subparsers( diff --git a/fba/database.py b/fba/database.py index 4a1ceb6..23bfab0 100644 --- a/fba/database.py +++ b/fba/database.py @@ -20,12 +20,14 @@ logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) # Connect to database +logger.debug("Opening database file blocks.db ...") connection = sqlite3.connect("blocks.db") # Attach trace function #connection.set_trace_callback(print) # Init row factory +logger.debug("connection='%s' - setting row factory ...", connection) connection.row_factory = sqlite3.Row # Get cursor diff --git a/fba/helpers/software.py b/fba/helpers/software.py index 4ada495..5f88dfd 100644 --- a/fba/helpers/software.py +++ b/fba/helpers/software.py @@ -48,7 +48,7 @@ def alias(software: str) -> str: elif software in ["hometown", "ecko", "fedibird", "glitchcafe"] or "되는 마스토돈" in software or "mastodon" in software: logger.debug("Setting mastodon: software='%s'", software) software = "mastodon" - elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey", "magnetar", "keybump", "dolphin", "calckey social", "azk.sns", "firefish", "qtmmsky", "iceshrimp", "owohub", "re+", "russkey", "loverskey"] or "shumihub" in software or "мисскей" in software or "milkey" in software or "misskey" in software: + elif software in ["slipfox calckey", "calckey", "groundpolis", "foundkey", "cherrypick", "meisskey", "magnetar", "keybump", "dolphin", "calckey social", "azk.sns", "firefish", "qtmmsky", "iceshrimp", "owohub", "re+", "russkey", "loverskey", "hajkey"] or "shumihub" in software or "мисскей" in software or "milkey" in software or "misskey" in software: logger.debug("Setting misskey: software='%s'", software) software = "misskey" elif software in ["runtube.re", "islameye"]: -- 2.39.5