Directory configs outside their directories (SaraSortd 7.2)

SaraSort finds configs and history files where SaraSortd 7.2 keeps them
(DirConfDir, [DirConfs]), and Settings > SaraSortd moves the existing ones
between "inside each directory" and one folder. Imports keep [DirConfs]
entries with moved directories, and Warnings flag a config folder inside an
input or a SaraSortd older than 7.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
sarahandClaude Opus 5.5 committed 2026-10-08 18:09:49 +02:00
1 parent edc2832a0f
commit 28252e3101
5 files changed
+177 -20

No files matched your search

+7
View File
@@ -172,6 +172,13 @@ def ApplyBundle(Config: AppConfig, TheBundle: Bundle, Remap: dict[str, str]) ->
Paths = GlobalDoc.get("DirectoryPaths", {})
for Key in ("InputDir", "OutputDir"):
_RemapList(TheSetup, Paths.get(Key), Remap)
# A moved directory keeps its own config file from [DirConfs] (SaraSortd 7.2).
DirConfs = GlobalDoc.get("DirConfs")
for Key in list(DirConfs.keys()) if DirConfs is not None else []:
Resolved = TheSetup.Parse(str(Key)).rstrip("/")
if Resolved in Remap:
DirConfs[TheSetup.Shorthand(Remap[Resolved])] = DirConfs[Key]
del DirConfs[Key]
ConfDir = Path(Config.SortdConfigDir).expanduser()
ConfDir.mkdir(parents=True, exist_ok=True)