"""
Nominatim configuration accessor.
"""
-import sys
import os
from dotenv import dotenv_values
def __init__(self, project_dir, config_dir):
self._config = dotenv_values(str((config_dir / 'env.defaults').resolve()))
- self._config.update(dotenv_values(str((project_dir / '.env').resolve())))
+ if project_dir is not None:
+ self._config.update(dotenv_values(str((project_dir / '.env').resolve())))
def __getattr__(self, name):
name = 'NOMINATIM_' + name
""" Return a copy of the OS environment with the Nominatim configuration
merged in.
"""
- env = dict(os.environ)
- env.update(self._config)
+ env = dict(self._config)
+ env.update(os.environ)
return env