]> git.openstreetmap.org Git - nominatim.git/commitdiff
Rebase with master
authorDarkshredder <srivastavayash58@gmail.com>
Mon, 29 Mar 2021 08:30:45 +0000 (14:00 +0530)
committerDarkshredder <srivastavayash58@gmail.com>
Mon, 29 Mar 2021 08:30:45 +0000 (14:00 +0530)
nominatim/cli.py
nominatim/clicmd/api.py
nominatim/clicmd/replication.py
nominatim/clicmd/setup.py

index 98ef9d58cd505601afc003bfe1d66af80fa89e43..5c2c8dfa17d639e5bcc9777108b91f436b6f6890 100644 (file)
@@ -112,6 +112,30 @@ class CommandlineParser:
 # pylint: disable=C0111
 # Using non-top-level imports to make pyosmium optional for replication only.
 # pylint: disable=E0012,C0415
+
+
+class SetupSpecialPhrases:
+    """\
+    Maintain special phrases.
+    """
+
+    @staticmethod
+    def add_args(parser):
+        group = parser.add_argument_group('Input arguments')
+        group.add_argument('--from-wiki', action='store_true',
+                           help='Pull special phrases from the OSM wiki.')
+        group = parser.add_argument_group('Output arguments')
+        group.add_argument('-o', '--output', default='-',
+                           help=("File to write the preprocessed phrases to."
+                                 "If omitted, it will be written to stdout."))
+
+    @staticmethod
+    def run(args):
+        if args.output != '-':
+            raise NotImplementedError('Only output to stdout is currently implemented.')
+        return run_legacy_script('specialphrases.php', '--wiki-import', nominatim_env=args)
+
+
 class UpdateAddData:
     """\
     Add additional data from a file or an online source.
@@ -179,16 +203,16 @@ class QueryExport:
                            help='Type of places to output (default: street)')
         group.add_argument('--output-format',
                            default='street;suburb;city;county;state;country',
-                           help="""Semicolon-separated list of address types
-                                   (see --output-type). Multiple ranks can be
-                                   merged into one column by simply using a
-                                   comma-separated list.""")
+                           help=("Semicolon-separated list of address types "
+                                 "(see --output-type). Multiple ranks can be "
+                                 "merged into one column by simply using a "
+                                 "comma-separated list."))
         group.add_argument('--output-all-postcodes', action='store_true',
-                           help="""List all postcodes for address instead of
-                                   just the most likely one""")
+                           help=("List all postcodes for address instead of "
+                                 "just the most likely one"))
         group.add_argument('--language',
-                           help="""Preferred language for output
-                                   (use local name, if omitted)""")
+                           help=("Preferred language for output "
+                                 "(use local name, if omitted)"))
         group = parser.add_argument_group('Filter arguments')
         group.add_argument('--restrict-to-country', metavar='COUNTRY_CODE',
                            help='Export only objects within country')
index 7185d97c14bf659f406e56d6c1b10e916467a278..c3e869b8aa60441af9b62c7f074f66a885e14ed9 100644 (file)
@@ -21,8 +21,8 @@ STRUCTURED_QUERY = (
 
 EXTRADATA_PARAMS = (
     ('addressdetails', 'Include a breakdown of the address into elements.'),
-    ('extratags', """Include additional information if available
-                     (e.g. wikipedia link, opening hours)."""),
+    ('extratags', ("Include additional information if available "
+                   "(e.g. wikipedia link, opening hours).")),
     ('namedetails', 'Include a list of alternative names.')
 )
 
@@ -49,8 +49,8 @@ def _add_api_output_arguments(parser):
                        choices=['geojson', 'kml', 'svg', 'text'],
                        help='Output geometry of results as a GeoJSON, KML, SVG or WKT.')
     group.add_argument('--polygon-threshold', type=float, metavar='TOLERANCE',
-                       help="""Simplify output geometry.
-                               Parameter is difference tolerance in degrees.""")
+                       help=("Simplify output geometry."
+                             "Parameter is difference tolerance in degrees."))
 
 
 class APISearch:
@@ -205,8 +205,8 @@ class APIDetails:
         objs.add_argument('--place_id', '-p', type=int,
                           help='Database internal identifier of the OSM object to look up.')
         group.add_argument('--class', dest='object_class',
-                           help="""Class type to disambiguated multiple entries
-                                   of the same object.""")
+                           help=("Class type to disambiguated multiple entries "
+                                 "of the same object."))
 
         group = parser.add_argument_group('Output arguments')
         for name, desc in DETAILS_SWITCHES:
index fc18945ec854469ac2421117bdc0aea493462c29..f9c5561a5c53edd099bb0855e9a58562335e3514 100644 (file)
@@ -29,17 +29,17 @@ class UpdateReplication:
                            help='Initialise the update process')
         group.add_argument('--no-update-functions', dest='update_functions',
                            action='store_false',
-                           help="""Do not update the trigger function to
-                                   support differential updates.""")
+                           help=("Do not update the trigger function to "
+                                 "support differential updates."))
         group = parser.add_argument_group('Arguments for updates')
         group.add_argument('--check-for-updates', action='store_true',
                            help='Check if new updates are available and exit')
         group.add_argument('--once', action='store_true',
-                           help="""Download and apply updates only once. When
-                                   not set, updates are continuously applied""")
+                           help=("Download and apply updates only once. When "
+                                 "not set, updates are continuously applied"))
         group.add_argument('--no-index', action='store_false', dest='do_index',
-                           help="""Do not index the new data. Only applicable
-                                   together with --once""")
+                           help=("Do not index the new data. Only applicable "
+                                 "together with --once"))
         group.add_argument('--osm2pgsql-cache', metavar='SIZE', type=int,
                            help='Size of cache to be used by osm2pgsql (in MB)')
         group = parser.add_argument_group('Download parameters')
index 056643aabfbbcd459bd874a307f0a41029fe8750..92d0694359e62ab48a58a255143b4733dfd316f6 100644 (file)
@@ -39,11 +39,11 @@ class SetupAll:
         group.add_argument('--reverse-only', action='store_true',
                            help='Do not create tables and indexes for searching')
         group.add_argument('--no-partitions', action='store_true',
-                           help="""Do not partition search indices
-                                   (speeds up import of single country extracts)""")
+                           help=("Do not partition search indices "
+                                 "(speeds up import of single country extracts)"))
         group.add_argument('--no-updates', action='store_true',
-                           help="""Do not keep tables that are only needed for
-                                   updating the database later""")
+                           help="Do not keep tables that are only needed for "
+                                "updating the database later")
         group = parser.add_argument_group('Expert options')
         group.add_argument('--ignore-errors', action='store_true',
                            help='Continue import even when errors in SQL are present')