]> git.openstreetmap.org Git - nominatim.git/blob - nominatim/clicmd/args.py
Merge pull request #2192 from lonvia/database-versioning
[nominatim.git] / nominatim / clicmd / args.py
1 """
2 Provides custom functions over command-line arguments.
3 """
4
5
6 class NominatimArgs: # pylint: disable=too-few-public-methods
7     """ Customized namespace class for the nominatim command line tool
8         to receive the command-line arguments.
9     """
10
11     def osm2pgsql_options(self, default_cache, default_threads):
12         """ Return the standard osm2pgsql options that can be derived
13             from the command line arguments. The resulting dict can be
14             further customized and then used in `run_osm2pgsql()`.
15         """
16         return dict(osm2pgsql=self.config.OSM2PGSQL_BINARY or self.osm2pgsql_path,
17                     osm2pgsql_cache=self.osm2pgsql_cache or default_cache,
18                     osm2pgsql_style=self.config.get_import_style_file(),
19                     threads=self.threads or default_threads,
20                     dsn=self.config.get_libpq_dsn(),
21                     flatnode_file=self.config.FLATNODE_FILE,
22                     tablespaces=dict(slim_data=self.config.TABLESPACE_OSM_DATA,
23                                      slim_index=self.config.TABLESPACE_OSM_INDEX,
24                                      main_data=self.config.TABLESPACE_PLACE_DATA,
25                                      main_index=self.config.TABLESPACE_PLACE_INDEX
26                                     )
27                     )