add a function to return a formatted version

Replaces the various repeated format strings throughout the code.
This commit is contained in:
Sarah Hoffmann
2022-05-10 23:00:18 +02:00
parent 5ff35d9984
commit 4e1e166c6a
7 changed files with 24 additions and 19 deletions

View File

@@ -34,3 +34,11 @@ POSTGIS_REQUIRED_VERSION = (2, 2)
# cmake/tool-installed.tmpl is used to build the binary 'nominatim'. Inside
# there is a call to set the variable value below.
GIT_COMMIT_HASH = None
# pylint: disable=consider-using-f-string
def version_str():
"""
Return a human-readable string of the version.
"""
return '{}.{}.{}-{}'.format(*NOMINATIM_VERSION)