]> git.openstreetmap.org Git - nominatim.git/commitdiff
add skeleton for new Nominatim executables
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 12 Jan 2021 09:17:28 +0000 (10:17 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 12 Jan 2021 09:17:28 +0000 (10:17 +0100)
CMakeLists.txt
cmake/tool.tmpl [new file with mode: 0755]
nominatim/__init__.py [new file with mode: 0644]
nominatim/tools.py [new file with mode: 0644]

index b4f4ddb8107e82d44a3ee897d54a61e347ac385d..15e34cdb0b65ab63d3893bd1a25d5f7669d3af5b 100644 (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()
 
 #-----------------------------------------------------------------------------
diff --git a/cmake/tool.tmpl b/cmake/tool.tmpl
new file mode 100755 (executable)
index 0000000..332e433
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/nominatim/tools.py b/nominatim/tools.py
new file mode 100644 (file)
index 0000000..3b77797
--- /dev/null
@@ -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.")
+