Added versions and full names to default extensions
This commit is contained in:
parent
a4196b6765
commit
f0f2a30d7e
4 changed files with 7 additions and 11 deletions
|
|
@ -359,7 +359,7 @@ class FastAutofocusAPI(Resource):
|
||||||
abort(503, "No stage connected. Unable to autofocus.")
|
abort(503, "No stage connected. Unable to autofocus.")
|
||||||
|
|
||||||
|
|
||||||
autofocus_extension_v2 = BaseExtension("autofocus")
|
autofocus_extension_v2 = BaseExtension("org.openflexure.autofocus", version="2.0.0-beta.1")
|
||||||
|
|
||||||
autofocus_extension_v2.add_method(fast_autofocus, "fast_autofocus")
|
autofocus_extension_v2.add_method(fast_autofocus, "fast_autofocus")
|
||||||
autofocus_extension_v2.add_method(autofocus, "autofocus")
|
autofocus_extension_v2.add_method(autofocus, "autofocus")
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ def tile(
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check if autofocus is enabled
|
# Check if autofocus is enabled
|
||||||
autofocus_extension = find_extension("autofocus")
|
autofocus_extension = find_extension("org.openflexure.autofocus")
|
||||||
if (
|
if (
|
||||||
autofocus_dz
|
autofocus_dz
|
||||||
and autofocus_extension
|
and autofocus_extension
|
||||||
|
|
@ -396,6 +396,6 @@ class TileScanAPI(Resource):
|
||||||
return task
|
return task
|
||||||
|
|
||||||
|
|
||||||
scan_extension_v2 = BaseExtension("scan")
|
scan_extension_v2 = BaseExtension("org.openflexure.scan", version="2.0.0-beta.1")
|
||||||
|
|
||||||
scan_extension_v2.add_view(TileScanAPI, "/tile")
|
scan_extension_v2.add_view(TileScanAPI, "/tile")
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ class ZipGetterAPIView(Resource):
|
||||||
return jsonify({"return": session_id})
|
return jsonify({"return": session_id})
|
||||||
|
|
||||||
|
|
||||||
zip_extension_v2 = BaseExtension("zip_builder")
|
zip_extension_v2 = BaseExtension("org.openflexure.zipbuilder", version="2.0.0-beta.1")
|
||||||
|
|
||||||
zip_extension_v2.add_view(ZipGetterAPIView, "/get/<string:session_id>")
|
zip_extension_v2.add_view(ZipGetterAPIView, "/get/<string:session_id>")
|
||||||
zip_extension_v2.add_view(ZipListAPIView, "/get")
|
zip_extension_v2.add_view(ZipListAPIView, "/get")
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,9 @@ class BaseExtension:
|
||||||
|
|
||||||
Handles binding route views and forms.
|
Handles binding route views and forms.
|
||||||
"""
|
"""
|
||||||
|
# TODO: Allow adding components to extensions
|
||||||
|
|
||||||
def __init__(self, name: str, description=""):
|
def __init__(self, name: str, description="", version="0.0.0"):
|
||||||
self._views = (
|
self._views = (
|
||||||
{}
|
{}
|
||||||
) # Key: Full, Python-safe ID. Val: Original rule, and view class
|
) # Key: Full, Python-safe ID. Val: Original rule, and view class
|
||||||
|
|
@ -35,6 +36,7 @@ class BaseExtension:
|
||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
self.description = get_docstring(self)
|
self.description = get_docstring(self)
|
||||||
|
self.version = str(version)
|
||||||
|
|
||||||
self.methods = {}
|
self.methods = {}
|
||||||
|
|
||||||
|
|
@ -64,12 +66,6 @@ class BaseExtension:
|
||||||
# Store the rule expansion information
|
# Store the rule expansion information
|
||||||
self._rules[rule] = self._views[view_id]
|
self._rules[rule] = self._views[view_id]
|
||||||
|
|
||||||
def register_action(self, view_class):
|
|
||||||
self.actions.append(view_class)
|
|
||||||
|
|
||||||
def register_property(self, view_class):
|
|
||||||
self.properties.append(view_class)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def meta(self):
|
def meta(self):
|
||||||
d = {}
|
d = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue