From 7e6ee45bb06e2c3459669556ce137c77cdc5abba Mon Sep 17 00:00:00 2001 From: John Chilton Date: Sun, 10 Feb 2013 11:13:51 -0600 Subject: [PATCH 1/2] 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 From 262413f7c0a1653ab3106f7dccd4c425b5181156 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 13 Feb 2013 10:45:56 -0600 Subject: [PATCH 2/2] Based on input from natefoo, replace root tool tag "upload" with inverse tag "workflow_compatible". Adjust logic in tools module accordingly. --- lib/galaxy/tools/__init__.py | 2 +- tools/data_source/upload.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 31339dbd5ed..afd3911ae82 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -1666,7 +1666,7 @@ class Tool( object ): # right now if self.tool_type.startswith( 'data_source' ): return False - if util.string_as_bool( root.get( "upload", "False" ) ): + if not util.string_as_bool( root.get( "workflow_compatible", "True" ) ): 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 85a6bac512d..de02c4afd36 100644 --- a/tools/data_source/upload.xml +++ b/tools/data_source/upload.xml @@ -1,6 +1,6 @@ - + from your computer