|
|
@ -21,6 +21,7 @@ from typing import (
|
|
|
|
List,
|
|
|
|
List,
|
|
|
|
Mapping,
|
|
|
|
Mapping,
|
|
|
|
Optional,
|
|
|
|
Optional,
|
|
|
|
|
|
|
|
Sequence,
|
|
|
|
Set,
|
|
|
|
Set,
|
|
|
|
Type,
|
|
|
|
Type,
|
|
|
|
TypeVar,
|
|
|
|
TypeVar,
|
|
|
@ -246,6 +247,11 @@ def encode_options(opts: Mapping[str, Any]) -> str:
|
|
|
|
return urlencode({k: str(v) for k, v in opts.items()}, quote_via=quote_plus)
|
|
|
|
return urlencode({k: str(v) for k, v in opts.items()}, quote_via=quote_plus)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@flask_app.template_filter()
|
|
|
|
|
|
|
|
def first_and_only(list: Sequence[T]) -> Optional[T]:
|
|
|
|
|
|
|
|
return list[0] if len(list) == 1 else None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@flask_app.template_global()
|
|
|
|
@flask_app.template_global()
|
|
|
|
def this_url(changed_args: Mapping[str, str] = {}) -> str:
|
|
|
|
def this_url(changed_args: Mapping[str, str] = {}) -> str:
|
|
|
|
if request.endpoint is None:
|
|
|
|
if request.endpoint is None:
|
|
|
|