From 7e6ee45bb06e2c3459669556ce137c77cdc5abba Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 10 Feb 2013 11:13:51 -0600 Subject: [PATCH] Add optional "upload" attribute to tool definitions. When extracting workflows, such tools are treated as inputs. This eliminates the need for the hack of hardcoding 'upload1' in tools.py and allows multiple upload tools to exist and function properly when extracting workflows. --- lib/galaxy/tools/__init__.py | 8 +++----- tools/data_source/upload.xml | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index cd8c0e34894..31339dbd5ed 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1085,7 +1085,7 @@ class Tool( object ): if requirements_elem: self.parse_requirements( requirements_elem ) # Determine if this tool can be used in workflows - self.is_workflow_compatible = self.check_workflow_compatible() + self.is_workflow_compatible = self.check_workflow_compatible(root) # Trackster configuration. trackster_conf = root.find( "trackster_conf" ) if trackster_conf is not None: @@ -1653,7 +1653,7 @@ class Tool( object ): version = requirement_elem.get( "version", None ) requirement = ToolRequirement( name=name, type=type, version=version ) self.requirements.append( requirement ) - def check_workflow_compatible( self ): + def check_workflow_compatible( self, root ): """ Determine if a tool can be used in workflows. External tools and the upload tool are currently not supported by workflows. @@ -1666,9 +1666,7 @@ class Tool( object ): # right now if self.tool_type.startswith( 'data_source' ): return False - # HACK: upload is (as always) a special case becuase file parameters - # can't be persisted. - if self.id == "upload1": + if util.string_as_bool( root.get( "upload", "False" ) ): return False # TODO: Anyway to capture tools that dynamically change their own # outputs? diff --git a/tools/data_source/upload.xml b/tools/data_source/upload.xml index a5fbfe147c5..85a6bac512d 100644 --- a/tools/data_source/upload.xml +++ b/tools/data_source/upload.xml @@ -1,6 +1,6 @@ - + from your computer