summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/profile.py28
-rw-r--r--core/updater.py4
2 files changed, 23 insertions, 9 deletions
diff --git a/core/profile.py b/core/profile.py
index 7ede859..8c73b4b 100644
--- a/core/profile.py
+++ b/core/profile.py
@@ -9,7 +9,7 @@ Lab profile — saves and loads the complete operator configuration:
• Derived channels — all virtual/computed channels
• Plot layout — pane arrangement, traces, axes, time window
-Profiles are stored as human-readable JSON files (.labdaq).
+Profiles are stored as human-readable JSON files (.labui).
"""
from __future__ import annotations
@@ -80,6 +80,8 @@ class Profile:
# plugin_state = {plugin_id: plugin.get_save_state()}
plugins_enabled: List[str] = field(default_factory=list)
# plugins_enabled = [plugin_id, ...] — which plugins were on when saved
+ plugins_manifest: List[Dict] = field(default_factory=list)
+ # plugins_manifest = [{plugin_id, name, version, description, requires, source_url}]
script_vars: Dict[str, Any] = field(default_factory=dict)
# script_vars — shared vars dict accessible as `vars` in all expressions
@@ -99,9 +101,10 @@ class Profile:
derived = d.get("derived", []),
plot = d.get("plot"),
settings = d.get("settings", {}),
- plugin_state = d.get("plugin_state", {}),
- plugins_enabled = d.get("plugins_enabled", []),
- script_vars = d.get("script_vars", {}),
+ plugin_state = d.get("plugin_state", {}),
+ plugins_enabled = d.get("plugins_enabled", []),
+ plugins_manifest = d.get("plugins_manifest", []),
+ script_vars = d.get("script_vars", {}),
)
def save(self, path: str):
@@ -127,10 +130,10 @@ class ProfileManager:
# Save
profile = ProfileManager.capture(registry, processor, chart_cfg,
control_specs, settings)
- profile.save("my_lab.labdaq")
+ profile.save("my_lab.labui")
# Load
- profile = Profile.load("my_lab.labdaq")
+ profile = Profile.load("my_lab.labui")
ProfileManager.apply(profile, registry, processor, ...)
"""
@@ -221,9 +224,20 @@ class ProfileManager:
with processor._lock:
p.script_vars = dict(processor._script_vars)
- # Plugin state + enabled list
+ # Plugin state + enabled list + manifest snapshot
if plugin_manager is not None:
p.plugins_enabled = plugin_manager.get_enabled_ids()
+ for pid in p.plugins_enabled:
+ m = plugin_manager.get_manifest(pid)
+ if m:
+ p.plugins_manifest.append({
+ "plugin_id": m.plugin_id,
+ "name": m.name,
+ "version": m.version,
+ "description": m.description,
+ "requires": m.requires,
+ "source_url": m.source_url,
+ })
for plugin in plugin_manager.get_loaded():
try:
state = plugin.get_save_state()
diff --git a/core/updater.py b/core/updater.py
index d22cd42..471ef0b 100644
--- a/core/updater.py
+++ b/core/updater.py
@@ -21,7 +21,7 @@ from typing import Optional
from core.app_settings import app_data_dir
from core.version import __version__ as CURRENT_VERSION
-APP_NAME = "labdaq"
+APP_NAME = "labui"
_RELEASE_BASE_URL = "https://github.com/c-kolset/labUI-python/releases/download/updates/"
METADATA_BASE_URL = _RELEASE_BASE_URL
@@ -50,7 +50,7 @@ def _bootstrap_root_json(metadata_dir: Path) -> None:
remotely on first use, by design (TUF's root of trust has to come from
somewhere already trusted, not from the same server being verified).
- So the copy bundled into the app (labdaq.spec bundles
+ So the copy bundled into the app (labui.spec bundles
scripts/release/repository/metadata/root.json to "repository/metadata")
has to be seeded into metadata_dir before the first Client is ever
constructed on a given machine. sys._MEIPASS is where PyInstaller puts