add skeleton for new Nominatim executables

This commit is contained in:
Sarah Hoffmann 2021-01-12 10:17:28 +01:00
parent a74e736283
commit 612fd50612
4 changed files with 36 additions and 0 deletions

View File

@ -111,6 +111,17 @@ if (BUILD_IMPORTER)
configure_file(${PROJECT_SOURCE_DIR}/cmake/script.tmpl
${PROJECT_BINARY_DIR}/utils/${script_source})
endforeach()
set(NOMINATIM_TOOLS
setup
update
admin
)
foreach (tool_name ${NOMINATIM_TOOLS})
configure_file(${PROJECT_SOURCE_DIR}/cmake/tool.tmpl
${PROJECT_BINARY_DIR}/nominatim-${tool_name})
endforeach()
endif()
#-----------------------------------------------------------------------------

11
cmake/tool.tmpl Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import sys
sys.path.insert(1, '@CMAKE_SOURCE_DIR@')
from nominatim import tools
tools.@tool_name@(module_dir='@CMAKE_BINARY_DIR@/module',
osm2pgsql_path='@CMAKE_BINARY_DIR@/osm2pgsql/osm2pgsql',
phplib_dir='@CMAKE_SOURCE_DIR@/lib',
data_dir='@CMAKE_SOURCE_DIR@')

0
nominatim/__init__.py Normal file
View File

14
nominatim/tools.py Normal file
View File

@ -0,0 +1,14 @@
"""
Provides the fronting for the Nominatim tools, command line and environment
parsing.
"""
def setup(**kwargs):
print("Functions for creating a Nominatim database and importing data.")
def update(**kwargs):
print("Functions for updating a Nominatim database.")
def admin(**kwargs):
print("Functions for maintaining a Nomiantim database.")