mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-19 10:51:34 +08:00
using the following command: ``` autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 . ```
35 lines
1.0 KiB
Python
Executable File
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()
|