mirror of
https://git.srhtnin.garden/sarah/SaraView.git
synced 2026-10-14 18:38:11 +02:00
Removed random comments and replaced em-dashes with hyphens.
This commit is contained in:
1 parent
6083e00504
commit
ee7e163837
24 files changed
+198
-363
No files matched your search
@@ -12,7 +12,6 @@ ConfigPath = ApplicationDirectory / "SaraViewConf.toml"
|
||||
|
||||
|
||||
def LoadConfig() -> dict[str, Any]:
|
||||
"""Load SaraView's TOML configuration from disk."""
|
||||
if not ConfigPath.is_file():
|
||||
raise FileNotFoundError(f"Missing configuration file: {ConfigPath}")
|
||||
|
||||
@@ -24,7 +23,6 @@ Config = LoadConfig()
|
||||
|
||||
|
||||
def GetRoots() -> dict[str, Path]:
|
||||
"""Return the configured named roots as resolved, absolute paths."""
|
||||
RawRoots = Config.get("Roots", {})
|
||||
Roots: dict[str, Path] = {}
|
||||
|
||||
@@ -35,10 +33,6 @@ def GetRoots() -> dict[str, Path]:
|
||||
|
||||
|
||||
def ResolvePath(RootName: str, RelativePath: str) -> Path:
|
||||
"""Resolve a client-supplied relative path against a named root.
|
||||
|
||||
Raises ValueError if the root is unknown or the resolved path escapes it.
|
||||
"""
|
||||
Roots = GetRoots()
|
||||
Root = Roots.get(RootName)
|
||||
|
||||
@@ -54,7 +48,6 @@ def ResolvePath(RootName: str, RelativePath: str) -> Path:
|
||||
|
||||
|
||||
def IsInternalPath(EntryPath: Path) -> bool:
|
||||
"""Return True if an entry should be hidden as a SaraTag internal file."""
|
||||
SaraTagConfig = Config.get("SaraTag", {})
|
||||
|
||||
if not SaraTagConfig.get("HideInternalFiles", True):
|
||||
|
||||
Reference in new issue
Block a user