Files
galaxy/scripts/api/workflow_execute.py
T
Nicola Soranzo 21b44bf348 Fix all E201 and E202 style errors
using the following command:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 .
```
2017-08-17 11:35:39 +01:00

35 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python
"""
Execute workflows from the command line.
Example calls:
python workflow_execute.py <api_key> <galaxy_url>/api/workflows f2db41e1fa331b3e 'Test API History' '38=ldda=0qr350234d2d192f'
python workflow_execute.py <api_key> <galaxy_url>/api/workflows f2db41e1fa331b3e 'hist_id=a912e9e5d84530d4' '38=hda=03501d7626bd192f'
"""
from __future__ import print_function
import os
import sys
from common import submit
def main():
try:
data = {}
data['workflow_id'] = sys.argv[3]
data['history'] = sys.argv[4]
data['ds_map'] = {}
# DBTODO If only one input is given, don't require a step
# mapping, just use it for everything?
for v in sys.argv[5:]:
step, src, ds_id = v.split('=')
data['ds_map'][step] = {'src': src, 'id': ds_id}
except IndexError:
print('usage: %s key url workflow_id history step=src=dataset_id' % os.path.basename(sys.argv[0]))
sys.exit(1)
submit(sys.argv[1], sys.argv[2], data)
if __name__ == '__main__':
main()