--- /dev/null
+[mypy]
+
+[mypy-icu.*]
+ignore_missing_imports = True
+
+[mypy-psycopg2.*]
+ignore_missing_imports = True
+
+[mypy-psutil]
+ignore_missing_imports = True
+
+[mypy-osmium.*]
+ignore_missing_imports = True
+
+[mypy-datrie.*]
+ignore_missing_imports = True
"""
Nominatim configuration accessor.
"""
+from typing import Dict, Any
import logging
import os
from pathlib import Path
from nominatim.errors import UsageError
LOG = logging.getLogger()
-CONFIG_CACHE = {}
+CONFIG_CACHE : Dict[str, Any] = {}
def flatten_config_list(content, section=''):
""" Flatten YAML configuration lists that contain include sections
"""
Functions for database migration to newer software versions.
"""
+from typing import List, Tuple, Callable
import logging
from psycopg2 import sql as pysql
LOG = logging.getLogger()
-_MIGRATION_FUNCTIONS = []
+_MIGRATION_FUNCTIONS : List[Tuple[str, Callable]] = []
def migrate(config, paths):
""" Check for the current database version and execute migrations,
from osmium.replication.server import ReplicationServer
from osmium import WriteHandler
except ImportError as exc:
- logging.getLogger().fatal("pyosmium not installed. Replication functions not available.\n"
- "To install pyosmium via pip: pip3 install osmium")
+ logging.getLogger().critical("pyosmium not installed. Replication functions not available.\n"
+ "To install pyosmium via pip: pip3 install osmium")
raise UsageError("replication tools not available") from exc
LOG = logging.getLogger()
Take a sp loader which load the phrases from an external source.
"""
- def __init__(self, config, db_connection, sp_loader) -> None:
+ def __init__(self, config, db_connection, sp_loader):
self.config = config
self.db_connection = db_connection
self.sp_loader = sp_loader