import bioblend.galaxy
from bioblend.galaxy.histories import HistoryClient
from bioblend.galaxy.datasets import DatasetClient
gi=bioblend.galaxy.GalaxyInstance(url='http://lbcd41.snv.jussieu.fr/galaxy/', key='xxx')
hc = HistoryClient( gi )
dc = DatasetClient( gi )
dataset_id='a72a8d806d8884e1'
history_id='86ef4cf00f944e48'
hc.download_dataset(dataset_id=dataset_id, history_id=history_id, file_path='~', use_default_filename=False)
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-21-c1bcfd7c7e41> in <module>()
7 dataset_id='a72a8d806d8884e1'
8 history_id='86ef4cf00f944e48'
----> 9 hc.download_dataset(dataset_id=dataset_id, history_id=history_id, file_path='~', use_default_filename=False)
/usr/local/lib/python2.7/dist-packages/bioblend-0.5.0-py2.7.egg/bioblend/galaxy/histories/__init__.pyc in download_dataset(self, history_id, dataset_id, file_path, use_default_filename, to_ext)
263 d_type = meta['data_type']
264 url = '/'.join([self.gi.base_url, 'datasets', meta['id'], "display"]) + "?to_ext=" + d_type
--> 265 req = urllib2.urlopen(url)
266 if use_default_filename:
267 file_local_path = os.path.join(file_path, meta['name'])
/usr/lib/python2.7/urllib2.pyc in urlopen(url, data, timeout)
125 if _opener is None:
126 _opener = build_opener()
--> 127 return _opener.open(url, data, timeout)
128
129 def install_opener(opener):
/usr/lib/python2.7/urllib2.pyc in open(self, fullurl, data, timeout)
408 for processor in self.process_response.get(protocol, []):
409 meth = getattr(processor, meth_name)
--> 410 response = meth(req, response)
411
412 return response
/usr/lib/python2.7/urllib2.pyc in http_response(self, request, response)
521 if not (200 <= code < 300):
522 response = self.parent.error(
--> 523 'http', request, response, code, msg, hdrs)
524
525 return response
/usr/lib/python2.7/urllib2.pyc in error(self, proto, *args)
446 if http_err:
447 args = (dict, 'default', 'http_error_default') + orig_args
--> 448 return self._call_chain(*args)
449
450 # XXX probably also want an abstract factory that knows when it makes
/usr/lib/python2.7/urllib2.pyc in _call_chain(self, chain, kind, meth_name, *args)
380 func = getattr(handler, meth_name)
381
--> 382 result = func(*args)
383 if result is not None:
384 return result
/usr/lib/python2.7/urllib2.pyc in http_error_default(self, req, fp, code, msg, hdrs)
529 class HTTPDefaultErrorHandler(BaseHandler):
530 def http_error_default(self, req, fp, code, msg, hdrs):
--> 531 raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
532
533 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found