]> git.openstreetmap.org Git - nominatim.git/commitdiff
Change command 'import-special-phrases --from-wiki' to 'special-phrases --import...
authorAntoJvlt <antonin.jolivat@gmail.com>
Fri, 26 Mar 2021 00:57:51 +0000 (01:57 +0100)
committerAntoJvlt <antonin.jolivat@gmail.com>
Fri, 26 Mar 2021 01:22:38 +0000 (02:22 +0100)
.github/workflows/ci-tests.yml
docs/admin/Import.md
lib-php/admin/specialphrases.php
nominatim/cli.py
nominatim/clicmd/special_phrases.py
test/python/test_cli.py
test/testfiles/phrase_settings.php

index e0e68a9c42303af52b52bf0a0a76695ef9ad552c..2f920a660f95c3f19fd7b8ad4ca1fcd542c243ca 100644 (file)
@@ -120,7 +120,7 @@ jobs:
               working-directory: data-env
 
             - name: Import special phrases
-              run: nominatim special-phrases --from-wiki | psql -d nominatim
+              run: nominatim special-phrases --import-from-wiki
               working-directory: data-env
 
             - name: Check import
index 43b11e91e8d278cb7bf8584f077f4a02cf906f39..e3a32481819d6a6b0cc93528f8c77b91eea309ab 100644 (file)
@@ -270,7 +270,7 @@ If you want to be able to search for places by their type through
 [special key phrases](https://wiki.openstreetmap.org/wiki/Nominatim/Special_Phrases)
 you also need to import these key phrases like this:
 
-    nominatim import-special-phrases --from-wiki
+    nominatim special-phrases --import-from-wiki
 
 Note that this command downloads the phrases from the wiki link above. You
 need internet access for the step.
index 92e655d0d187941eeef8376cfd9dfca20f749b31..84bcfb5c949ad51da1f019372a99546ec618310e 100644 (file)
@@ -7,5 +7,5 @@ require_once(CONST_LibDir.'/init-cmd.php');
 loadSettings(getcwd());
 
 (new \Nominatim\Shell(getSetting('NOMINATIM_TOOL')))
-    ->addParams('import-special-phrases', '--from-wiki')
+    ->addParams('special-phrases', '--import-from-wiki')
     ->run();
index d6d8e3887cf90ff708720c4415e322b00374d081..0876d9a44df960e9589ca8577521e58d9d56cc50 100644 (file)
@@ -254,7 +254,7 @@ def nominatim(**kwargs):
     parser.add_subcommand('freeze', clicmd.SetupFreeze)
     parser.add_subcommand('replication', clicmd.UpdateReplication)
 
-    parser.add_subcommand('import-special-phrases', clicmd.ImportSpecialPhrases)
+    parser.add_subcommand('special-phrases', clicmd.ImportSpecialPhrases)
 
     parser.add_subcommand('add-data', UpdateAddData)
     parser.add_subcommand('index', clicmd.UpdateIndex)
index a35a97423938da2cdecc8da13d875475c5026050..99e825925ad63443b305543624cde60572740fee 100644 (file)
@@ -1,5 +1,5 @@
 """
-    Implementation of the 'import-special-phrases' command.
+    Implementation of the 'special-phrases' command.
 """
 import logging
 from nominatim.tools.special_phrases import SpecialPhrasesImporter
@@ -17,12 +17,12 @@ class ImportSpecialPhrases:
     @staticmethod
     def add_args(parser):
         group = parser.add_argument_group('Input arguments')
-        group.add_argument('--from-wiki', action='store_true',
+        group.add_argument('--import-from-wiki', action='store_true',
                            help='Import special phrases from the OSM wiki to the database.')
 
     @staticmethod
     def run(args):
-        if args.from_wiki:
+        if args.import_from_wiki:
             LOG.warning('Special phrases importation starting')
             with connect(args.config.get_libpq_dsn()) as db_connection:
                 SpecialPhrasesImporter(
index 9aeca3de2545248329e1cc8227e87554c9c368ae..eb0ee58487b5917112824ad4b0ce2940d5d21f3a 100644 (file)
@@ -174,7 +174,7 @@ def test_index_command(mock_func_factory, temp_db_cursor, params, do_bnds, do_ra
 def test_special_phrases_command(temp_db, mock_func_factory):
     func = mock_func_factory(nominatim.clicmd.special_phrases.SpecialPhrasesImporter, 'import_from_wiki')
 
-    call_nominatim('import-special-phrases', '--from-wiki')
+    call_nominatim('special-phrases', '--import-from-wiki')
 
     assert func.called == 1
 
index f64b8d3bf084420e7e206760ae7d8e82327bee1a..945235bd8c9549e90b320a8ff3d0c1107632946c 100644 (file)
@@ -17,4 +17,4 @@ $aTagsWhitelist
  = array(
     'highway' => array('bus_stop', 'rest_area', 'raceway'),
     'building' => array(),
-   );
\ No newline at end of file
+   );