forked from hans/Nominatim
make formatting module non-static
This commit is contained in:
@@ -14,6 +14,7 @@ import math
|
||||
from ..config import Configuration
|
||||
from .. import logging as loglib
|
||||
from ..core import NominatimAPIAsync
|
||||
from ..result_formatting import FormatDispatcher
|
||||
|
||||
CONTENT_TEXT = 'text/plain; charset=utf-8'
|
||||
CONTENT_XML = 'text/xml; charset=utf-8'
|
||||
@@ -28,6 +29,7 @@ class ASGIAdaptor(abc.ABC):
|
||||
"""
|
||||
content_type: str = CONTENT_TEXT
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def get(self, name: str, default: Optional[str] = None) -> Optional[str]:
|
||||
""" Return an input parameter as a string. If the parameter was
|
||||
@@ -60,6 +62,7 @@ class ASGIAdaptor(abc.ABC):
|
||||
body of the response to 'output'.
|
||||
"""
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def base_uri(self) -> str:
|
||||
""" Return the URI of the original request.
|
||||
@@ -72,6 +75,12 @@ class ASGIAdaptor(abc.ABC):
|
||||
"""
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def formatting(self) -> FormatDispatcher:
|
||||
""" Return the formatting object to use.
|
||||
"""
|
||||
|
||||
|
||||
def get_int(self, name: str, default: Optional[int] = None) -> int:
|
||||
""" Return an input parameter as an int. Raises an exception if
|
||||
the parameter is given but not in an integer format.
|
||||
|
||||
Reference in New Issue
Block a user