Private
Public Access
cleaning cruft part 2
This commit is contained in:
+4
-8
@@ -15,8 +15,7 @@ class LayoutFile:
|
||||
intended to be installed to cwd/manualslop_layout.ini by App._post_init
|
||||
when the user's INI is empty or missing. The raw text is opaque to
|
||||
this module; structure parsing (ImGui sections, [Window] entries)
|
||||
is the consumer's responsibility.
|
||||
[C: src/layouts.py:load_layouts_from_dir, src/gui_2.py:_install_default_layout_if_empty]"""
|
||||
is the consumer's responsibility."""
|
||||
name: str
|
||||
raw_text: str
|
||||
source_path: Path
|
||||
@@ -25,8 +24,7 @@ class LayoutFile:
|
||||
|
||||
def load_layouts_from_file(path: Path, scope: str) -> dict[str, LayoutFile]:
|
||||
"""Load ONE layout file and return a 1-entry dict. Public API matches
|
||||
themes' load_themes_from_toml shape (dict out).
|
||||
[C: src/layouts.py:load_layouts_from_dir]"""
|
||||
themes' load_themes_from_toml shape (dict out)."""
|
||||
out: dict[str, LayoutFile] = {}
|
||||
if not path.exists() or not path.is_file():
|
||||
return out
|
||||
@@ -45,8 +43,7 @@ def load_layouts_from_dir(path: Path, scope: str) -> dict[str, LayoutFile]:
|
||||
or all-skip (per the 'delete to turn off' pattern in
|
||||
conductor/code_styleguides/feature_flags.md). Per-file errors are
|
||||
drained via Result + stderr warn, mirroring
|
||||
src/theme_models.py:load_themes_from_dir.
|
||||
[C: src/layouts.py:load_layouts_from_disk]"""
|
||||
src/theme_models.py:load_themes_from_dir."""
|
||||
out: dict[str, LayoutFile] = {}
|
||||
if not path.exists() or not path.is_dir():
|
||||
return out
|
||||
@@ -73,8 +70,7 @@ def load_layouts_from_disk() -> dict[str, LayoutFile]:
|
||||
"""Load all bundled layouts from the global layouts dir
|
||||
(resolved via src/paths.py:get_layouts_dir()). Cached at the
|
||||
module level; callers iterate the returned dict. The 'delete to
|
||||
turn off' guarantee: a missing or empty layouts/ dir returns {}.
|
||||
[C: src/gui_2.py:_install_default_layout_if_empty]"""
|
||||
turn off' guarantee: a missing or empty layouts/ dir returns {}."""
|
||||
global _LAYOUTS_CACHE
|
||||
layouts_dir = get_layouts_dir()
|
||||
_LAYOUTS_CACHE = load_layouts_from_dir(layouts_dir, scope="global")
|
||||
|
||||
Reference in New Issue
Block a user