mdvtools.project_router

Classes

ProjectBlueprint

ProjectBlueprint_v2

SingleProjectShim

Module Contents

class mdvtools.project_router.ProjectBlueprint(name: str, _ignored: str, url_prefix: str)[source]
blueprints: Dict[str, ProjectBlueprint][source]
static register_app(app: flask.Flask) None[source]
name[source]
url_prefix[source]
routes: Dict[re.Pattern[str], Callable][source]
route(rule: str, **options: Any) Callable[source]
dispatch_request(subpath: str) flask.Response[source]

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/<path:path>’ becomes ‘/tracks/(.*)’. If we get a request for ‘/tracks/mytrack’, it will match the rule and call the method with ‘mytrack’ as the argument.

class mdvtools.project_router.ProjectBlueprint_v2(name: str, _ignored: str, url_prefix: str)[source]
blueprints: Dict[str, ProjectBlueprint_v2][source]
TIMESTAMP_UPDATE_INTERVAL[source]
AUTH_ENABLED[source]
static register_app(app: flask.Flask) None[source]
static is_authenticated() bool[source]

Checks if the user is authenticated.

name[source]
url_prefix[source]
routes: Dict[re.Pattern[str], Tuple[Callable, Dict[str, Any]]][source]
route(rule: str, **options: Any) Callable[source]
dispatch_request(subpath: str, project_id) flask.Response[source]

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/<path:path>’ becomes ‘/tracks/(.*)’. If we get a request for ‘/tracks/mytrack’, it will match the rule and call the method with ‘mytrack’ as the argument.

class mdvtools.project_router.SingleProjectShim(app: flask.Flask)[source]
app[source]
route(rule: str, **options: Any) Callable[source]