Make downloader take srid into account

This commit is contained in:
Nick Hurley 2013-02-01 16:43:29 -08:00
Родитель 0ff88c4424
Коммит 73e14ee874
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -21,16 +21,18 @@ class StoneRidgeDownloader(object):
'download_platform') 'download_platform')
self.download_suffix = stoneridge.get_config('machine', self.download_suffix = stoneridge.get_config('machine',
'download_suffix') 'download_suffix')
self.srid = stoneridge.get_config('run', 'srid')
self.downloaddir = stoneridge.get_config('run', 'download') self.downloaddir = stoneridge.get_config('run', 'download')
logging.debug('server = %s' % (self.server,)) logging.debug('server = %s' % (self.server,))
logging.debug('download root = %s' % (self.downloadroot,)) logging.debug('download root = %s' % (self.downloadroot,))
logging.debug('platform = %s' % (self.download_platform,)) logging.debug('platform = %s' % (self.download_platform,))
logging.debug('suffix = %s' % (self.download_suffix,)) logging.debug('suffix = %s' % (self.download_suffix,))
logging.debug('srid = %s' % (self.srid,))
logging.debug('downloaddir = %s' % (self.downloaddir,)) logging.debug('downloaddir = %s' % (self.downloaddir,))
def _download_file(self, filename): def _download_file(self, filename):
url = 'http://%s/%s/%s/%s' % (self.server, self.downloadroot, url = 'http://%s/%s/%s/%s/%s' % (self.server, self.downloadroot,
self.download_platform, filename) self.srid, self.download_platform, filename)
logging.debug('downloading %s from %s' % (filename, url)) logging.debug('downloading %s from %s' % (filename, url))
r = requests.get(url) r = requests.get(url)
if r.status_code != 200: if r.status_code != 200: