mirror of
https://git.srhtnin.garden/sarah/SaraSort.git
synced 2026-10-13 18:28:18 +02:00
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:
1 parent
edc2832a0f
commit
28252e3101
5 files changed
+177
-20
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user