openflexure-microscope-server/openflexure_microscope/plugins/testing/dynamic_form_example/api.py
2019-11-27 14:34:52 +00:00

24 lines
436 B
Python

from openflexure_microscope.devel import (
MicroscopeViewPlugin,
JsonResponse,
request,
jsonify,
taskify,
)
import logging
class DoAPI(MicroscopeViewPlugin):
"""
A dynamic example API plugin
"""
def get(self):
values = {"val_int": self.plugin.val_int}
return jsonify(values)
def post(self):
self.plugin.val_int += 1
return jsonify({"response": "completed"})