diff --git a/Config.toml b/Config.toml index 6891c07..22e4afe 100644 --- a/Config.toml +++ b/Config.toml @@ -4,6 +4,7 @@ SilentMode = 0 CheckInput = 3 DotFiles = 0 Logging = 1 +WriteDirConf = 1 [Variables] NextNum = "!" @@ -21,7 +22,7 @@ VarCall = "%%" [DirectoryPaths] RootDir = "Unset" -InputDir = [ "%RootDir%"] +InputDir = [ "%Pic%/Input"] OutputDir = [ "%RootDir%/Output"] LogDir = "%RootDir%/.Logs" FailedDir = "%RootDir%/.Failed" diff --git a/DirConfig.toml b/DirConfig.toml index 5a86105..8db519d 100644 --- a/DirConfig.toml +++ b/DirConfig.toml @@ -3,14 +3,7 @@ LastFile = "Unset" ParentDir = "Unset" [[Files]] -Pattern = "*.jpg" -NewFileName = "~^" -NextNum = 1 -NextChar = "A" -CaseSensitive = 0 - -[[Files]] -Pattern = "*.png" +Pattern = "*" NewFileName = "~^" NextNum = 1 NextChar = "A" diff --git a/SaraSortd.py b/SaraSortd.py index 7dc9118..83a7b93 100644 --- a/SaraSortd.py +++ b/SaraSortd.py @@ -194,10 +194,11 @@ def Dir(Path, Output = True, CopyConf = True): os.makedirs(Path, exist_ok=True) if (CopyConf): - Clone("DirConfig.toml", Path, f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml") - - UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName) - UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config") + NewDirConf = f"{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml" + if (Conf["WriteDirConf"] == 1 or not os.path.exists(os.path.join(f"{Path}/{NewDirConf}"))): + Clone("DirConfig.toml", Path, NewDirConf) + UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "ParentDir", ParentName) + UpdateConf(f"{Path}/{Parse(String = ConfNames["DirConfName"], Path = ConfPath, Parent = ParentName)}.toml", "Title", f"{ParentName} Config") if (Output): ParsedPath = Parse(String = Path)