Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
756 B
Python
Raw Permalink Normal View History

#!/usr/bin/env python
"""
Import workflows from the command line.
Example calls:
python workflow_import.py <api_key> <galaxy_url> '/path/to/workflow/file [--add_to_menu]'
"""
2016-11-23 18:04:33 +00:00
import os
import sys
from common import submit
def main():
api_key = sys.argv[1]
api_base_url = sys.argv[2]
2024-04-27 16:03:22 +01:00
api_url = f"{api_base_url}/api/workflows"
try:
data = {}
data["installed_repository_file"] = sys.argv[3]
if len(sys.argv) > 4 and sys.argv[4] == "--add_to_menu":
data["add_to_menu"] = True
except IndexError:
2024-04-27 16:03:22 +01:00
print(f"usage: {os.path.basename(sys.argv[0])} key galaxy_url workflow_file")
sys.exit(1)
2017-08-17 00:33:02 +01:00
submit(api_key, api_url, data, return_formatted=False)
2016-11-14 21:12:14 +00:00
if __name__ == "__main__":
main()