add documentation for custom formatters

This commit is contained in:
Sarah Hoffmann
2024-08-14 18:22:59 +02:00
parent 5a61d3d5f6
commit 19eb4d91a0
5 changed files with 182 additions and 2 deletions

View File

@@ -39,5 +39,6 @@ from .results import (SourceTable as SourceTable,
SearchResult as SearchResult,
SearchResults as SearchResults)
from .localization import (Locales as Locales)
from .result_formatting import (FormatDispatcher as FormatDispatcher)
from .version import NOMINATIM_API_VERSION as __version__

View File

@@ -20,8 +20,8 @@ ErrorFormatFunc = Callable[[str, str, int], str]
class FormatDispatcher:
""" Helper class to conveniently create formatting functions in
a module using decorators.
""" Container for formatting functions for results.
Functions can conveniently be added by using decorated functions.
"""
def __init__(self, content_types: Optional[Mapping[str, str]] = None) -> None: