Put with Files: choose kits, as Manage Kits does, and rebuild kits.scode
A kits step after the zip is chosen, laid out as the Manage Kits panel: installed kits (what the app needs, greyed), installed but not used, kits available on the computer, not supported; the Action cell offers Keep at / Upgrade to / Downgrade to / Add at / REMOVE; Upgrade all kits to latest version. Kits not in the backup can be added, with their dependencies. The ticked kits make app.sab's schema (encode_sax takes the kit list, as Ontrol's PutApp rewrites it). When they are not the device's kits, or Rebuild kits.scode is ticked, kits.scode is built for them with Ontrol's sedonac from the Niagara install, after checking the natives the kits call against the device's platform manifest (PutApp.checkNativeCompatibility). - kit_build.py: platform manifest lookup, native check, sedonac run - palette.kit_versions: a checksum released more than once stands for its highest version (ontrolPlatform 1.0.1, not 1.0.0) - palette.unsupported_kits takes the kit list to judge against - sab_app: a type from a kit the app does not list is a clear error Tested on a P-ION: a rebuild for its own kits is byte-identical to the one it runs; adding and then removing the logic kit both come back running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+16
-7
@@ -67,7 +67,12 @@ def kit_versions(kit_name):
|
||||
for entry in os.listdir(kit_dir):
|
||||
match = pattern.match(entry)
|
||||
if match:
|
||||
versions[_norm_checksum(match.group(1))] = match.group(2)
|
||||
# A checksum released more than once (ontrolPlatform 1.0.0 and 1.0.1)
|
||||
# stands for its highest version, as the devices report it.
|
||||
key, version = _norm_checksum(match.group(1)), match.group(2)
|
||||
if (key not in versions or
|
||||
version_sort_key(version) > version_sort_key(versions[key])):
|
||||
versions[key] = version
|
||||
|
||||
_versions_cache[kit_name] = versions
|
||||
return versions
|
||||
@@ -269,7 +274,7 @@ def _platforms_db():
|
||||
return os.path.join(app_state.SEDONA_HOME, "platforms", "db")
|
||||
|
||||
|
||||
def _platform_native_kits():
|
||||
def _platform_native_kits(sax_names=None):
|
||||
"""Return (matching, all_platforms) — two sets of kit names.
|
||||
|
||||
*matching* is the union of nativeKit names from platform builds that include
|
||||
@@ -278,8 +283,10 @@ def _platform_native_kits():
|
||||
|
||||
A kit that appears in *all_platforms* but not in *matching* has native code
|
||||
compiled for a different device and cannot work with this SAX.
|
||||
|
||||
sax_names stands in for the open file's kits when given.
|
||||
"""
|
||||
sax_names = set(app_state.active_schema_kits.keys())
|
||||
sax_names = set(app_state.active_schema_kits.keys() if sax_names is None else sax_names)
|
||||
db = _platforms_db()
|
||||
if not os.path.isdir(db):
|
||||
return None, None
|
||||
@@ -335,8 +342,9 @@ def _platform_native_kits():
|
||||
return (matching if found else None), all_platforms
|
||||
|
||||
|
||||
def unsupported_kits():
|
||||
"""Kit names that cannot work with the open file's platform.
|
||||
def unsupported_kits(sax_names=None):
|
||||
"""Kit names that cannot work with the open file's platform -- or with the platform
|
||||
of the kits in `sax_names`, when given.
|
||||
|
||||
A kit is unsupported when:
|
||||
- it has native code (hasNatives or listed as nativeKit on some platform)
|
||||
@@ -345,11 +353,12 @@ def unsupported_kits():
|
||||
|
||||
Kits that depend on an unsupported kit are also flagged.
|
||||
"""
|
||||
sax_names = frozenset(app_state.active_schema_kits.keys())
|
||||
sax_names = frozenset(app_state.active_schema_kits.keys() if sax_names is None
|
||||
else sax_names)
|
||||
if sax_names in _unsupported_cache:
|
||||
return _unsupported_cache[sax_names]
|
||||
|
||||
matching_natives, all_natives = _platform_native_kits()
|
||||
matching_natives, all_natives = _platform_native_kits(sax_names)
|
||||
if matching_natives is None:
|
||||
_unsupported_cache[sax_names] = set()
|
||||
return set()
|
||||
|
||||
Reference in New Issue
Block a user