construct the download path correctly, even on Windows

This commit is contained in:
Rob Speer 2014-09-08 10:56:48 -04:00
parent c55a701885
commit 6d90cef415

View File

@ -5,7 +5,7 @@ DB_DIR = (os.environ.get('WORDFREQ_DATA')
or os.path.expanduser('~/.cache/wordfreq')) or os.path.expanduser('~/.cache/wordfreq'))
# When the minor version number increments, the data may change. # When the minor version number increments, the data may change.
VERSION = '0.4.0' VERSION = '0.4.1'
MINOR_VERSION = '.'.join(VERSION.split('.')[:2]) MINOR_VERSION = '.'.join(VERSION.split('.')[:2])
# Put these options together to make a database filename. # Put these options together to make a database filename.
@ -16,10 +16,10 @@ CACHE_SIZE = 100000
# Where can the data be downloaded from? # Where can the data be downloaded from?
DOWNLOAD_URL = (os.environ.get('WORDFREQ_URL') DOWNLOAD_URL = (os.environ.get('WORDFREQ_URL')
or 'http://wordfreq.services.luminoso.com/') or 'http://wordfreq.services.luminoso.com')
RAW_DATA_URL = os.path.join(DOWNLOAD_URL, MINOR_VERSION, 'wordfreq-data.tar.gz') RAW_DATA_URL = '/'.join([DOWNLOAD_URL, MINOR_VERSION, 'wordfreq-data.tar.gz'])
DB_URL = os.path.join(DOWNLOAD_URL, MINOR_VERSION, DB_URL = '/'.join([DOWNLOAD_URL, MINOR_VERSION,
'wordfreq-%s.db' % MINOR_VERSION) 'wordfreq-%s.db' % MINOR_VERSION])
# How do we actually get it there? This is the path, including hostname, to give # How do we actually get it there? This is the path, including hostname, to give
# to scp to upload the file. # to scp to upload the file.