[fix] Moving default Geonames DB path to a shared module
This commit is contained in:
@@ -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)))
|
sys.path.append(os.path.realpath(os.path.join(os.pardir, os.pardir)))
|
||||||
|
|
||||||
from geodata.encoding import safe_decode
|
from geodata.encoding import safe_decode
|
||||||
|
from geodata.geonames.paths import *
|
||||||
|
|
||||||
from geodata.file_utils import *
|
from geodata.file_utils import *
|
||||||
from geodata.log import *
|
from geodata.log import *
|
||||||
@@ -27,12 +28,6 @@ from itertools import islice, chain
|
|||||||
log_to_file(sys.stderr)
|
log_to_file(sys.stderr)
|
||||||
logger = logging.getLogger('geonames.sqlite')
|
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/'
|
BASE_URL = 'http://download.geonames.org/export/'
|
||||||
|
|
||||||
DUMP_URL = urlparse.urljoin(BASE_URL, 'dump/')
|
DUMP_URL = urlparse.urljoin(BASE_URL, 'dump/')
|
||||||
|
|||||||
9
scripts/geodata/geonames/paths.py
Normal file
9
scripts/geodata/geonames/paths.py
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user