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.