adapt plugin imports

This commit is contained in:
Sarah Hoffmann 2024-05-18 19:35:18 +02:00
parent 44fface92a
commit dc7c11a9d1
6 changed files with 6 additions and 6 deletions

View File

@ -49,6 +49,6 @@ async def make_query_analyzer(conn: SearchConnection) -> AbstractQueryAnalyzer:
log().comment(f"No tokenizer named '{name}' available. Database not set up properly.")
raise RuntimeError('Tokenizer not found')
module = importlib.import_module(f'nominatim.api.search.{name}_tokenizer')
module = importlib.import_module(f'nominatim_api.api.search.{name}_tokenizer')
return cast(AbstractQueryAnalyzer, await module.create_query_analyzer(conn))

View File

@ -9,7 +9,7 @@ Path settings for extra data used by Nominatim.
"""
from pathlib import Path
PHPLIB_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-php').resolve()
PHPLIB_DIR = None
SQLLIB_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-sql').resolve()
DATA_DIR = (Path(__file__) / '..' / '..' / '..' / 'data').resolve()
CONFIG_DIR = (Path(__file__) / '..' / '..' / '..' / 'settings').resolve()

View File

@ -180,7 +180,7 @@ class AdminServe:
else:
port = 8088
server_module = importlib.import_module(f'nominatim.server.{args.engine}.server')
server_module = importlib.import_module(f'nominatim_db.server.{args.engine}.server')
app = server_module.get_application(args.project_dir)
uvicorn.run(app, host=host, port=port)

View File

@ -41,7 +41,7 @@ def _import_tokenizer(name: str) -> TokenizerModule:
"Check the setting of NOMINATIM_TOKENIZER.", name)
raise UsageError('Tokenizer not found')
return importlib.import_module('nominatim.tokenizer.' + name + '_tokenizer')
return importlib.import_module('nominatim_db.tokenizer.' + name + '_tokenizer')
def create_tokenizer(config: Configuration, init_db: bool = True,

View File

@ -184,7 +184,7 @@ class TokenAnalyzerRule:
raise UsageError("'analyzer' parameter needs to be simple string")
self._analysis_mod: AnalysisModule = \
config.load_plugin_module(analyzer_name, 'nominatim.tokenizer.token_analysis')
config.load_plugin_module(analyzer_name, 'nominatim_db.tokenizer.token_analysis')
self.config = self._analysis_mod.configure(rules, normalizer,
transliterator)

View File

@ -35,7 +35,7 @@ class PlaceSanitizer:
raise UsageError("'step' attribute must be a simple string.")
module: SanitizerHandler = \
config.load_plugin_module(func['step'], 'nominatim.tokenizer.sanitizers')
config.load_plugin_module(func['step'], 'nominatim_db.tokenizer.sanitizers')
self.handlers.append(module.create(SanitizerConfig(func)))