mdvtools.project_router ======================= .. py:module:: mdvtools.project_router Classes ------- .. autoapisummary:: mdvtools.project_router.ProjectBlueprint mdvtools.project_router.ProjectBlueprint_v2 mdvtools.project_router.SingleProjectShim Module Contents --------------- .. py:class:: ProjectBlueprint(name: str, _ignored: str, url_prefix: str) .. py:attribute:: blueprints :type: Dict[str, ProjectBlueprint] .. py:method:: register_app(app: flask.Flask) -> None :staticmethod: .. py:attribute:: name .. py:attribute:: url_prefix .. py:attribute:: routes :type: Dict[re.Pattern[str], Callable] .. py:method:: route(rule: str, **options: Any) -> Callable .. py:method:: dispatch_request(subpath: str) -> flask.Response We need to parse `subpath` so that we can route in a compatible way: Currently, we have regex patterns as keys in self.routes that match the subpath, with groups for any dynamic parts, so '/tracks/' becomes '/tracks/(.*)'. If we get a request for '/tracks/mytrack', it will match the rule and call the method with 'mytrack' as the argument. .. py:class:: ProjectBlueprint_v2(name: str, _ignored: str, url_prefix: str) .. py:attribute:: blueprints :type: Dict[str, ProjectBlueprint_v2] .. py:attribute:: TIMESTAMP_UPDATE_INTERVAL .. py:attribute:: AUTH_ENABLED .. py:method:: register_app(app: flask.Flask) -> None :staticmethod: .. py:method:: is_authenticated() -> bool :staticmethod: Checks if the user is authenticated. .. py:attribute:: name .. py:attribute:: url_prefix .. py:attribute:: routes :type: Dict[re.Pattern[str], Tuple[Callable, Dict[str, Any]]] .. py:method:: route(rule: str, **options: Any) -> Callable .. py:method:: dispatch_request(subpath: str, project_id) -> flask.Response We need to parse `subpath` so that we can route in a compatible way: Currently, we have regex patterns as keys in self.routes that match the subpath, with groups for any dynamic parts, so '/tracks/' becomes '/tracks/(.*)'. If we get a request for '/tracks/mytrack', it will match the rule and call the method with 'mytrack' as the argument. .. py:class:: SingleProjectShim(app: flask.Flask) .. py:attribute:: app .. py:method:: route(rule: str, **options: Any) -> Callable