Loading openflexure_microscope/api/v2/views/actions/camera.py +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ class CaptureAPI(Resource): ) @marshal_with(capture_schema) @doc_response(200, description="Capture successful") @doc(tags=["foo"]) def post(self, args): """ Create a new capture Loading openflexure_microscope/common/flask_labthings/spec.py +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ def view2path(rule: str, view: Resource, spec: APISpec): def view2operations(view: Resource, spec: APISpec): # Operations inherit tags from parent inherited_tags = [] if hasattr(view, "__apispec__"): inherited_tags = getattr(view, "__apispec__").get("tags", []) # Build dictionary of operations (HTTP methods) ops = {} for method in Resource.methods: if hasattr(view, method): Loading @@ -47,6 +53,7 @@ def view2operations(view: Resource, spec: APISpec): { "description": get_docstring(getattr(view, method)), "summary": get_summary(getattr(view, method)), "tags": inherited_tags, }, ) Loading openflexure_microscope/common/labthings_core/utilities.py +9 −1 Original line number Diff line number Diff line Loading @@ -19,10 +19,18 @@ def get_summary(obj): def rupdate(d, u): for k, v in u.items(): if isinstance(v, collections.abc.Mapping): # Merge lists if they're present in both objects if isinstance(v, list): if not k in d: d[k] = [] if isinstance(d[k], list): d[k].extend(v) # Recursively merge dictionaries if the element is a dictionary elif isinstance(v, collections.abc.Mapping): if not k in d: d[k] = {} d[k] = rupdate(d.get(k, {}), v) # If not a list or dictionary, overwrite old value with new value else: d[k] = v return d Loading Loading
openflexure_microscope/api/v2/views/actions/camera.py +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ class CaptureAPI(Resource): ) @marshal_with(capture_schema) @doc_response(200, description="Capture successful") @doc(tags=["foo"]) def post(self, args): """ Create a new capture Loading
openflexure_microscope/common/flask_labthings/spec.py +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ def view2path(rule: str, view: Resource, spec: APISpec): def view2operations(view: Resource, spec: APISpec): # Operations inherit tags from parent inherited_tags = [] if hasattr(view, "__apispec__"): inherited_tags = getattr(view, "__apispec__").get("tags", []) # Build dictionary of operations (HTTP methods) ops = {} for method in Resource.methods: if hasattr(view, method): Loading @@ -47,6 +53,7 @@ def view2operations(view: Resource, spec: APISpec): { "description": get_docstring(getattr(view, method)), "summary": get_summary(getattr(view, method)), "tags": inherited_tags, }, ) Loading
openflexure_microscope/common/labthings_core/utilities.py +9 −1 Original line number Diff line number Diff line Loading @@ -19,10 +19,18 @@ def get_summary(obj): def rupdate(d, u): for k, v in u.items(): if isinstance(v, collections.abc.Mapping): # Merge lists if they're present in both objects if isinstance(v, list): if not k in d: d[k] = [] if isinstance(d[k], list): d[k].extend(v) # Recursively merge dictionaries if the element is a dictionary elif isinstance(v, collections.abc.Mapping): if not k in d: d[k] = {} d[k] = rupdate(d.get(k, {}), v) # If not a list or dictionary, overwrite old value with new value else: d[k] = v return d Loading