import logging
from pathlib import Path
-from nominatim_core.errors import UsageError
-from nominatim_core.config import Configuration
-from nominatim_core.typing import Protocol
+from ..errors import UsageError
+from ..config import Configuration
+from ..typing import Protocol
+
LOG = logging.getLogger()
+
class Subcommand(Protocol):
"""
Interface to be implemented by classes implementing a CLI subcommand.
# Arguments to all query functions
format: str
+ list_formats: bool
addressdetails: bool
extratags: bool
namedetails: bool
polygon_geojson: bool
group_hierarchy: bool
-
def osm2pgsql_options(self, default_cache: int,
default_threads: int) -> Dict[str, Any]:
""" Return the standard osm2pgsql options that can be derived
return dict(osm2pgsql=self.config.OSM2PGSQL_BINARY or self.config.lib_dir.osm2pgsql,
osm2pgsql_cache=self.osm2pgsql_cache or default_cache,
osm2pgsql_style=self.config.get_import_style_file(),
- osm2pgsql_style_path=self.config.config_dir,
+ osm2pgsql_style_path=self.config.lib_dir.lua,
threads=self.threads or default_threads,
dsn=self.config.get_libpq_dsn(),
flatnode_file=str(self.config.get_path('FLATNODE_FILE') or ''),
slim_index=self.config.TABLESPACE_OSM_INDEX,
main_data=self.config.TABLESPACE_PLACE_DATA,
main_index=self.config.TABLESPACE_PLACE_INDEX
- )
- )
-
+ )
+ )
def get_osm_file_list(self) -> Optional[List[Path]]:
""" Return the --osm-file argument as a list of Paths or None