Demo sets¶
Source: data/demo_sets.py
Bundled sample learning-set templates under src/assets/demos/, reserved
basename protection for create/import, and install_demo_sets() used by
Settings. Conceptual flow is in
Data and storage.
Bundled demo learning sets: registry, reserved names, and install helpers.
Demo CSV templates live under the app assets directory. Installation copies them
into csv_files/ with fixed basenames and registers catalog rows. Those
basenames stay reserved so create/import cannot claim them.
DemoInstallResult
dataclass
¶
Outcome of install_demo_sets for UI messaging.
Source code in src/learning_app/data/demo_sets.py
get_assets_dir ¶
Return the absolute assets directory for local runs and flet build.
Source code in src/learning_app/data/demo_sets.py
resolve_demo_asset_path ¶
is_set_name_reserved ¶
is_demo_already_installed ¶
Return whether a demo basename is already in the catalog or on disk.
Source code in src/learning_app/data/demo_sets.py
is_set_name_taken ¶
Return whether a set basename is reserved, catalogued, or present on disk.
Used when allocating names for create/import so reserved demo basenames
cannot be claimed. Demo installation uses is_demo_already_installed
instead (reserved names are expected for demos).
Source code in src/learning_app/data/demo_sets.py
allocate_unique_set_basename ¶
Return a free *_words.csv / *_definitions.csv basename.
Reserved demo names, catalog entries, and on-disk files are treated as
occupied. When preferred_basename is taken, appends 1, 2, …
before the kind suffix.
Source code in src/learning_app/data/demo_sets.py
install_demo_sets ¶
install_demo_sets() -> DemoInstallResult
Copy missing demo templates into storage and register them in the catalog.
Skips a demo when its fixed basename is already in the catalog or on disk. Always resets learning statistics on newly installed copies.