diff --git a/scripts/geodata/geonames/geonames_sqlite.py b/scripts/geodata/geonames/geonames_sqlite.py index 17c56dbf..01d7e5df 100644 --- a/scripts/geodata/geonames/geonames_sqlite.py +++ b/scripts/geodata/geonames/geonames_sqlite.py @@ -18,6 +18,7 @@ this_dir = os.path.realpath(os.path.dirname(__file__)) sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir))) from geodata.encoding import safe_decode +from geodata.geonames.paths import * from geodata.file_utils import * from geodata.log import * @@ -27,12 +28,6 @@ from itertools import islice, chain log_to_file(sys.stderr) logger = logging.getLogger('geonames.sqlite') -GEONAMES_DB_NAME = 'geonames.db' - -DEFAULT_GEONAMES_DB_PATH = os.path.join(this_dir, os.path.pardir, - os.path.pardir, os.path.pardir, - 'data', 'geonames', GEONAMES_DB_NAME) - BASE_URL = 'http://download.geonames.org/export/' DUMP_URL = urlparse.urljoin(BASE_URL, 'dump/') diff --git a/scripts/geodata/geonames/paths.py b/scripts/geodata/geonames/paths.py new file mode 100644 index 00000000..47229f5a --- /dev/null +++ b/scripts/geodata/geonames/paths.py @@ -0,0 +1,9 @@ +import os + +this_dir = os.path.realpath(os.path.dirname(__file__)) + +GEONAMES_DB_NAME = 'geonames.db' + +DEFAULT_GEONAMES_DB_PATH = os.path.join(this_dir, os.path.pardir, + os.path.pardir, os.path.pardir, + 'data', 'geonames', GEONAMES_DB_NAME)