From 8229a14cfe944a19e0dc29335d7aa85e4f6fc57a Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Tue, 25 Feb 2025 18:13:01 -0500 Subject: [PATCH] Cleaned up file/dir paths a bit, make app_config global app_config is global pending the next commit which will separate out all the config file handling from main() as the LSP was saying the main function had become too complex. --- discorss.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/discorss.py b/discorss.py index 4fe079b..83c71bd 100755 --- a/discorss.py +++ b/discorss.py @@ -17,6 +17,7 @@ from pathlib import Path import json import time import os +import sys import re config_dir = os.environ.get("XDG_CONFIG_HOME") @@ -26,13 +27,13 @@ if config_dir is None: config_dir = str(home_dir) + "/.config/discorss" else: config_file_path = config_dir + r"/discorss/discorss.conf" -log_file_path = r"/var/log/discorss" -# log_file_path = r"./log" -log_file_name = r"/app.log" +log_dir = r"/var/log/discorss" +log_file_path = r"/app.log" # Yes, I know you "can't parse HTML with regex", but # just watch me. html_filter = re.compile(r"\<\/?([A-Za-z \:\.\/\"\=])*\>") success_codes = ["200", "201", "202", "203", "204", "205", "206"] +app_config = {} # This function gets and formats the brief excerpt that goes in the embed