add sanic development server implementation

This commit is contained in:
Sarah Hoffmann
2022-12-01 17:58:22 +01:00
parent 45c675bd78
commit 23dabad0b0
7 changed files with 98 additions and 3 deletions

View File

@@ -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.

View File

@@ -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