def _pre_query_builder_GET_hook(self, options):
if options.esqb_kwargs.include_tax_tree and 'all' not in options.esqb_kwargs.species:
headers = {'content-type': 'application/x-www-form-urlencoded',
'user-agent': 'Python-requests_mygene.info/{} (gzip)'.format(requests.__version__)}
res = requests.post(self.web_settings.INCLUDE_TAX_TREE_REDIRECT_TEMPLATE.format(
ids=','.join(['{}'.format(sid) for sid in options.esqb_kwargs.species])), headers=headers)
if res.status_code == requests.codes.ok:
options['esqb_kwargs']['species'] = [str(x) for x in res.json()]
#logging.debug('tax_tree species: {}'.format(options.esqb_kwargs.species))
return options
评论列表
文章目录