]> git.openstreetmap.org Git - nominatim.git/commit
reorganize code around result formatting
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 24 Jan 2023 16:20:51 +0000 (17:20 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 24 Jan 2023 16:20:51 +0000 (17:20 +0100)
commit8f4426fbc8038c159eae999e74d5a4f1fb992530
tree3e8ceb2e4bf7129580a45d477ef0ea38e5e927b5
parent32c1e59622a8e9f76c351160e7150e625e3238a3
reorganize code around result formatting

Code is now organized by api version. So formatting has moved to
the api.v1 module. Instead of holding a separate ResultFormatter
object per result format, simply move the functions to the
formater collector and hand in the requested format as a parameter.
Thus reorganized, the api.v1 module can export three simple functions
for result formatting which in turn makes the code that uses
the formatters much simpler.
nominatim/api/result_formatting.py [moved from nominatim/result_formatter/base.py with 53% similarity]
nominatim/api/v1/__init__.py [new file with mode: 0644]
nominatim/api/v1/format.py [moved from nominatim/result_formatter/v1.py with 84% similarity]
nominatim/clicmd/api.py
nominatim/result_formatter/__init__.py [deleted file]
nominatim/server/falcon/server.py
nominatim/server/sanic/server.py
nominatim/server/starlette/server.py
test/python/api/test_result_formatting_v1.py [new file with mode: 0644]
test/python/result_formatter/test_v1.py [deleted file]