From 612fd5061275557617dc0726ea08e4c5b82b3474 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Tue, 12 Jan 2021 10:17:28 +0100 Subject: [PATCH] add skeleton for new Nominatim executables --- CMakeLists.txt | 11 +++++++++++ cmake/tool.tmpl | 11 +++++++++++ nominatim/__init__.py | 0 nominatim/tools.py | 14 ++++++++++++++ 4 files changed, 36 insertions(+) create mode 100755 cmake/tool.tmpl create mode 100644 nominatim/__init__.py create mode 100644 nominatim/tools.py diff --git a/CMakeLists.txt b/CMakeLists.txt index b4f4ddb8..15e34cdb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() #----------------------------------------------------------------------------- diff --git a/cmake/tool.tmpl b/cmake/tool.tmpl new file mode 100755 index 00000000..332e4330 --- /dev/null +++ b/cmake/tool.tmpl @@ -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@') diff --git a/nominatim/__init__.py b/nominatim/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nominatim/tools.py b/nominatim/tools.py new file mode 100644 index 00000000..3b777976 --- /dev/null +++ b/nominatim/tools.py @@ -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.") + -- 2.39.5