X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/45c675bd786ff70c1417fc8e92cff8d3a2ad6e75..a72e2ecb3f4c2d0127e4a8e9cba1b1414976854d:/nominatim/result_formatter/base.py?ds=sidebyside diff --git a/nominatim/result_formatter/base.py b/nominatim/result_formatter/base.py index 88f4d918..d77f4db8 100644 --- a/nominatim/result_formatter/base.py +++ b/nominatim/result_formatter/base.py @@ -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.