Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load_shed_repos(runnable):
if runnable.type.name != "galaxy_workflow":
return []
path = runnable.path
if path.endswith(".ga"):
generate_tool_list_from_ga_workflow_files.generate_tool_list_from_workflow([path], "Tools from workflows", "tools.yml")
with open("tools.yml", "r") as f:
tools = yaml.safe_load(f)["tools"]
else:
# It'd be better to just infer this from the tool shed ID somehow than
# require explicit annotation like this... I think?
with open(path, "r") as f:
workflow = yaml.safe_load(f)
tools = workflow.get("tools", [])
return tools