commit/galaxy-central: dan: Fix for SelectToolParameters that utilize dynamic options and that make use of __trans__ failing at get_legal_values().
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/03c7a893d7dd/ Changeset: 03c7a893d7dd User: dan Date: 2015-02-06 16:56:54+00:00 Summary: Fix for SelectToolParameters that utilize dynamic options and that make use of __trans__ failing at get_legal_values(). Affected #: 1 file diff -r c494ee616c1aafa755e4d80b893697623e4431bb -r 03c7a893d7dd3822939a20e26b7fbb496feab492 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -782,13 +782,17 @@ self.legal_values.add( value ) self.is_dynamic = ( ( self.dynamic_options is not None ) or ( self.options is not None ) ) + def _get_dynamic_options_call_other_values( self, trans, other_values ): + call_other_values = { "__trans__": trans } + if other_values: + call_other_values.update( other_values.dict ) + return call_other_values + def get_options( self, trans, other_values ): if self.options: return self.options.get_options( trans, other_values ) elif self.dynamic_options: - call_other_values = {"__trans__": trans} - if other_values: - call_other_values.update( other_values.dict ) + call_other_values = self._get_dynamic_options_call_other_values( trans, other_values ) try: return eval( self.dynamic_options, self.tool.code_namespace, call_other_values ) except Exception: @@ -805,8 +809,10 @@ return map( _get_UnvalidatedValue_value, set( v for _, v, _ in self.options.get_options( trans, other_values ) ) ) elif self.dynamic_options: try: - return set( v for _, v, _ in eval( self.dynamic_options, self.tool.code_namespace, other_values ) ) - except Exception: + call_other_values = self._get_dynamic_options_call_other_values( trans, other_values ) + return set( v for _, v, _ in eval( self.dynamic_options, self.tool.code_namespace, call_other_values ) ) + except Exception, e: + log.debug( 'Determining legal values failed for "%s": %s', self.name, e ) return set() else: return self.legal_values 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)
-
commits-noreply@bitbucket.org