From 8baee314d0673b4aaa1a70d363b1e656ec98a42c Mon Sep 17 00:00:00 2001 From: heisner-tillman Date: Sun, 3 Mar 2024 17:26:41 +0100 Subject: [PATCH] Type return of download method --- .../webapps/galaxy/services/workflows.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/galaxy/webapps/galaxy/services/workflows.py b/lib/galaxy/webapps/galaxy/services/workflows.py index 58819e3f95b6..b9f758becb0d 100644 --- a/lib/galaxy/webapps/galaxy/services/workflows.py +++ b/lib/galaxy/webapps/galaxy/services/workflows.py @@ -41,6 +41,9 @@ SetWorkflowMenuPayload, SetWorkflowMenuSummary, StoredWorkflowDetailed, + WorkflowDictEditorSummary, + WorkflowDictPreviewSummary, + WorkflowDictRunSummary, ) from galaxy.util.tool_shed.tool_shed_registry import Registry from galaxy.webapps.galaxy.services.base import ServiceBase @@ -96,6 +99,22 @@ def download_workflow(self, trans, workflow_id, history_id, style, format, versi if style == "format2" and format != "json-download": return PlainTextResponse(ordered_dump(ret_dict)) + elif style == "export": + return ret_dict + elif style == "editor": + return WorkflowDictEditorSummary(**ret_dict) + elif style == ("legacy" or "instance"): + return StoredWorkflowDetailed(**ret_dict) + elif style == "run": + return WorkflowDictRunSummary(**ret_dict) + elif style == "preview": + return WorkflowDictPreviewSummary(**ret_dict) + elif style == "format2": + return ret_dict + elif style == "format2_wrapped_yaml": + return ret_dict + elif style == "ga": + return ret_dict else: return ret_dict