mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
fix: improve logging messages and documentation (#803)
This commit is contained in:
@@ -79,7 +79,7 @@ def load_dict(filepath:str, content_label:str = "") -> dict[str, Any]:
|
||||
|
||||
def load_dict_if_exists(filepath:str, content_label:str = "") -> dict[str, Any] | None:
|
||||
abs_filepath = files.abspath(filepath)
|
||||
LOG.info("Loading %s[%s]...", content_label and content_label + " from " or "", abs_filepath)
|
||||
LOG.debug("Loading %s[%s]...", content_label and content_label + " from " or "", abs_filepath)
|
||||
|
||||
__, file_ext = os.path.splitext(filepath)
|
||||
if file_ext not in {".json", ".yaml", ".yml"}:
|
||||
|
||||
@@ -89,7 +89,7 @@ def detect_installation_mode() -> InstallationMode | None:
|
||||
LOG.debug("Checking for portable config at: %s", portable_config)
|
||||
|
||||
if portable_config.exists():
|
||||
LOG.info("Detected installation mode: %s", "portable")
|
||||
LOG.debug("Detected installation mode: %s", "portable")
|
||||
return "portable"
|
||||
|
||||
# Check for XDG installation
|
||||
@@ -97,11 +97,11 @@ def detect_installation_mode() -> InstallationMode | None:
|
||||
LOG.debug("Checking for XDG config at: %s", xdg_config)
|
||||
|
||||
if xdg_config.exists():
|
||||
LOG.info("Detected installation mode: %s", "xdg")
|
||||
LOG.debug("Detected installation mode: %s", "xdg")
|
||||
return "xdg"
|
||||
|
||||
# Neither exists - first run
|
||||
LOG.info("No existing installation found")
|
||||
LOG.info("No existing configuration (portable or system-wide) found")
|
||||
return None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user