From ef5b40ffef34a85340285d8c98b50736641def0d Mon Sep 17 00:00:00 2001 From: Sarahtonin Date: Thu, 2 Apr 2026 15:43:43 +0200 Subject: [PATCH] Fixed ConfCheck so that it doesn't raise nonexistent errors. --- Config.toml | 2 +- SaraSortd.py | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Config.toml b/Config.toml index ad7e0bd..b0914b8 100644 --- a/Config.toml +++ b/Config.toml @@ -27,7 +27,7 @@ VarCall = "%%" # The characters used at the start and end of variable calls. Th RootDir = "Unset" # Parent directory. Folder where all SaraSortd folders live. InputDir = ["%RootDir%"] # If files get put here, they'll be sorted. OutputDir = ["%RootDir%"] # Where sortted files go. -LogDir = ".%RootDir%/Logs" # Where log files from SaraSortd go. +LogDir = "%RootDir%/.Logs" # Where log files from SaraSortd go. FailedDir =".%RootDir%/Failed" # For files that failed to be sorted. [Names] diff --git a/SaraSortd.py b/SaraSortd.py index c5a6544..0921b6a 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -111,26 +111,33 @@ def LogWrite(Text): def ConfCheck(): - for Item in ConfVars: - if (Item == None or Item == "Unset"): - TextOutput = Parse(ConfLog["Unset"], Item) + for Parameter, Value in ConfVars.items(): + if (Value == None or Value == "Unset"): + TextOutput = Parse(ConfLog["Unset"], Parameter) LogWrite(TextOutput) Speak(TextOutput) Error() - for Item in ConfDirs: - if (Item == None or Item == "Unset"): - TextOutput = Parse(ConfLog["Unset"], Item) + for Parameter, Value in ConfDirs.items(): + if (Value == None or Value == "Unset"): + TextOutput = Parse(ConfLog["Unset"], Parameter) LogWrite(TextOutput) Speak(TextOutput) Error() + + for Parameter, Value in ConfNames.items(): + if (Value == None or Value == "Unset"): + TextOutput = Parse(ConfLog["Unset"], Parameter) + LogWrite(TextOutput) + Speak(TextOutput) + Error() - for Item in ConfLog: - if (Item == None or Item == "Unset"): - TextOutput = Parse(ConfLog["Unset"], Item) + for Parameter, Value in ConfLog.items(): + if (Value == None or Value == "Unset"): + TextOutput = Parse(ConfLog["Unset"], Parameter) LogWrite(TextOutput) Speak(TextOutput) - Error() + Error() def Init(): @@ -144,7 +151,7 @@ def Init(): TextOutput = Parse(ConfLog["Start"]) LogWrite(TextOutput) Speak(TextOutput) - + Main() else: