commit/galaxy-central: dan: Some fixes for interplay between DataToolParameter, implicit datatype conversion and dynamic select lists. Closes #491.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/894112e0b9d5/ changeset: 894112e0b9d5 user: dan date: 2011-06-09 17:26:41 summary: Some fixes for interplay between DataToolParameter, implicit datatype conversion and dynamic select lists. Closes #491. TODO: Revamp this interplay to allow the use of implicit datatype conversion by allowing manual input of selections by e.g. Text Boxes. affected #: 3 files (327 bytes) --- a/lib/galaxy/tools/__init__.py Thu Jun 09 11:24:19 2011 -0400 +++ b/lib/galaxy/tools/__init__.py Thu Jun 09 11:26:41 2011 -0400 @@ -923,6 +923,8 @@ if not self.check_values: return for input in self.inputs.itervalues(): + if input.name not in value: + value[input.name] = input.get_initial_value( None, value ) if isinstance( input, ToolParameter ): callback( "", input, value[input.name] ) else: --- a/lib/galaxy/tools/parameters/basic.py Thu Jun 09 11:24:19 2011 -0400 +++ b/lib/galaxy/tools/parameters/basic.py Thu Jun 09 11:26:41 2011 -0400 @@ -699,8 +699,8 @@ # Old style dynamic options, no dependency information so there isn't # a lot we can do: if we're dealing with workflows, have to assume # late validation no matter what. - if self.dynamic_options is not None: - return ( trans is None or trans.workflow_building_mode ) + if self.dynamic_options is not None and ( trans is None or trans.workflow_building_mode ): + return True # If we got this far, we can actually look at the dependencies # to see if their values will not be available until runtime. for dep_name in self.get_dependencies(): @@ -1354,7 +1354,7 @@ happens twice (here and when generating HTML). """ # Can't look at history in workflow mode - if trans.workflow_building_mode: + if trans is None or trans.workflow_building_mode: return DummyDataset() assert trans is not None, "DataToolParameter requires a trans" history = trans.get_history() @@ -1370,7 +1370,7 @@ pass #no valid options def dataset_collector( datasets ): def is_convertable( dataset ): - target_ext, converted_dataset = dataset.find_conversion_destination( self.formats, converter_safe = self.converter_safe( None, trans ) ) + target_ext, converted_dataset = dataset.find_conversion_destination( self.formats, converter_safe = self.converter_safe( context, trans ) ) if target_ext is not None: return True return False --- a/lib/galaxy/util/expressions.py Thu Jun 09 11:24:19 2011 -0400 +++ b/lib/galaxy/util/expressions.py Thu Jun 09 11:26:41 2011 -0400 @@ -21,6 +21,8 @@ if self.parent is not None and key in self.parent: return self.parent[key] raise KeyError( key ) + def __setitem__( self, key, value ): + self.dict[key] = value def __contains__( self, key ): if key in self.dict: return True @@ -29,4 +31,7 @@ return False def __str__( self ): return str( self.dict ) - + def __nonzero__( self ): + if not self.dict and not self.parent: + return False + return True Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket