forked from hans/Nominatim
add sanic development server implementation
This commit is contained in:
@@ -28,6 +28,12 @@ class ResultFormatter(Generic[T]):
|
||||
return list(self.functions.keys())
|
||||
|
||||
|
||||
def supports_format(self, fmt: str) -> bool:
|
||||
""" Check if the given format is supported by this formatter.
|
||||
"""
|
||||
return fmt in self.functions
|
||||
|
||||
|
||||
def format(self, result: T, fmt: str) -> str:
|
||||
""" Convert the given result into a string using the given format.
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ def _format_status_json(result: StatusResult) -> str:
|
||||
out['status'] = result.status
|
||||
out['message'] = result.message
|
||||
if result.data_updated is not None:
|
||||
out['data_updated'] = result.data_updated
|
||||
out['data_updated'] = result.data_updated.isoformat()
|
||||
out['software_version'] = result.software_version
|
||||
if result.database_version is not None:
|
||||
out['database_version'] = result.database_version
|
||||
|
||||
Reference in New Issue
Block a user