[hg] galaxy 1673: Allow workflows to recognize "data_meta" filte...
details: http://www.bx.psu.edu/hg/galaxy/rev/f61f2128c692 changeset: 1673:f61f2128c692 user: James Taylor <james@jamestaylor.org> date: Tue Dec 16 17:30:19 2008 -0500 description: Allow workflows to recognize "data_meta" filters in dynamic options as forcing runtime validation. 2 file(s) affected in this change: lib/galaxy/tools/parameters/basic.py lib/galaxy/tools/parameters/dynamic_options.py diffs (59 lines): diff -r 79d9195e5899 -r f61f2128c692 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py Tue Dec 16 14:31:00 2008 -0500 +++ b/lib/galaxy/tools/parameters/basic.py Tue Dec 16 17:30:19 2008 -0500 @@ -495,7 +495,7 @@ # Dynamic options are not yet supported in workflow, allow # specifying the value as text for now. if self.is_dynamic and trans.workflow_building_mode \ - and ( self.options is None or self.options.dataset_ref_name is not None ): + and ( self.options is None or self.options.has_dataset_dependencies ): assert isinstance( value, UnvalidatedValue ) value = value.value if self.multiple: @@ -519,7 +519,7 @@ # HACK: trans may be None here if doing late validation, this is # treated the same as not being in workflow mode if self.is_dynamic and ( trans and trans.workflow_building_mode ) \ - and ( self.options is None or self.options.dataset_ref_name is not None ): + and ( self.options is None or self.options.has_dataset_dependencies ): if self.multiple: value = value.split( "\n" ) return UnvalidatedValue( value ) @@ -560,7 +560,7 @@ def get_initial_value( self, trans, context ): # More working around dynamic options for workflow if self.is_dynamic and trans.workflow_building_mode \ - and ( self.options is None or self.options.dataset_ref_name is not None ): + and ( self.options is None or self.options.has_dataset_dependencies ): # Really the best we can do? return UnvalidatedValue( None ) options = list( self.get_options( trans, context ) ) diff -r 79d9195e5899 -r f61f2128c692 lib/galaxy/tools/parameters/dynamic_options.py --- a/lib/galaxy/tools/parameters/dynamic_options.py Tue Dec 16 14:31:00 2008 -0500 +++ b/lib/galaxy/tools/parameters/dynamic_options.py Tue Dec 16 17:30:19 2008 -0500 @@ -78,6 +78,7 @@ Filter.__init__( self, d_option, elem ) self.ref_name = elem.get( "ref", None ) assert self.ref_name is not None, "Required 'ref' attribute missing from filter" + d_option.has_dataset_dependencies = True self.key = elem.get( "key", None ) assert self.key is not None, "Required 'key' attribute missing from filter" self.column = elem.get( "column", None ) @@ -290,6 +291,9 @@ self.file_fields = None self.largest_index = 0 self.dataset_ref_name = None + # True if the options generation depends on one or more other parameters + # that are dataset inputs + self.has_dataset_dependencies = False self.validators = [] self.converter_safe = True @@ -320,6 +324,7 @@ self.file_fields = self.parse_file_fields( open( data_file ) ) elif dataset_file is not None: self.dataset_ref_name = dataset_file + self.has_dataset_dependencies = True self.converter_safe = False elif from_parameter is not None: transform_lines = elem.get( 'transform_lines', None )
participants (1)
-
Greg Von Kuster