mxcubeweb.core.server.resource_handler#
Functions
Make sure that all the arguments of the function are typehinted correctly. |
|
|
Validate that |
|
Validate that input string contains only alphanumeric characters and/or dot (.). |
Classes
|
Flask resource handler that dynamically creates routes for hardware objects. |
|
Flask resource handler that dynamically creates routes for hardware objects. |
|
|
|
- class mxcubeweb.core.server.resource_handler.AdapterResourceHandler(name: str, url_prefix: str, handler_dict: dict[str, object], app: object, exports: list[dict[str, str]], commands: list[str], attributes: list[str])[source]#
Bases:
ResourceHandlerFlask resource handler that dynamically creates routes for hardware objects.
AdapterResourceHandler is a Flask resource handler that dynamically creates routes for hardware objects based on their attributes and methods. It supports GET and PUT requests for attributes and commands respectively.
- class mxcubeweb.core.server.resource_handler.ComponentResourceHandler(name: str, url_prefix: str, handler_dict: dict[str, object], app: object, exports: list[dict[str, str]], commands: list[str], attributes: list[str])[source]#
Bases:
ResourceHandlerFlask resource handler that dynamically creates routes for hardware objects.
AdapterResourceHandler is a Flask resource handler that dynamically creates routes for hardware objects based on their attributes and methods. It supports GET and PUT requests for attributes and commands respectively.
- mxcubeweb.core.server.resource_handler.assert_valid_type_arguments(func)[source]#
Make sure that all the arguments of the function are typehinted correctly.
Make sure that all the arguments of the function are typehinted as pydantic model, float, int, str or bool
- mxcubeweb.core.server.resource_handler.valid_object_id(object_id: str) bool[source]#
Validate that
object_idcontains onlyA-Z,a-z, and.,_.