X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/79da96b369aa86fdcec21c4d0eb8465b6ed54fc5..754846d9dc125e3caa8a97b8381918b565a55289:/nominatim/tools/country_info.py diff --git a/nominatim/tools/country_info.py b/nominatim/tools/country_info.py index 1f7b7996..897ac220 100644 --- a/nominatim/tools/country_info.py +++ b/nominatim/tools/country_info.py @@ -15,10 +15,15 @@ class _CountryInfo: self._info = {} def load(self, configfile): + """ Load the country properties from the configuration files, + if they are not loaded yet. + """ if not self._info: - self._info = yaml.safe_load(configfile.read_text()) + self._info = yaml.safe_load(configfile.read_text(encoding='utf-8')) def items(self): + """ Return tuples of (country_code, property dict) as iterable. + """ return self._info.items() @@ -30,7 +35,6 @@ def setup_country_config(configfile): file. """ _COUNTRY_INFO.load(configfile) - print(_COUNTRY_INFO._info) def setup_country_tables(dsn, sql_dir, ignore_partitions=False):