commit/galaxy-central: dan: Handle update_state for Conditional tool parameters when a currently valid current_case value has not been provided.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/ea6698177726/ Changeset: ea6698177726 User: dan Date: 2014-06-13 19:30:23 Summary: Handle update_state for Conditional tool parameters when a currently valid current_case value has not been provided. Affected #: 2 files diff -r 8a608db6cf83b653a433f43b501f4047f63d248b -r ea6698177726a9e94931dcd818db52f5c0e2aec3 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -2392,7 +2392,18 @@ # Get value of test param and determine current case value, test_param_error = \ check_param( trans, input.test_param, test_incoming, context, source=source ) - current_case = input.get_current_case( value, trans ) + try: + current_case = input.get_current_case( value, trans ) + except ValueError, e: + #load default initial value + if not test_param_error: + test_param_error = str( e ) + if trans is not None: + history = trans.get_history() + else: + history = None + value = input.test_param.get_initial_value( trans, context, history=history ) + current_case = input.get_current_case( value, trans ) if current_case != old_current_case: # Current case has changed, throw away old state group_state = state[input.name] = {} diff -r 8a608db6cf83b653a433f43b501f4047f63d248b -r ea6698177726a9e94931dcd818db52f5c0e2aec3 lib/galaxy/tools/parameters/grouping.py --- a/lib/galaxy/tools/parameters/grouping.py +++ b/lib/galaxy/tools/parameters/grouping.py @@ -472,7 +472,7 @@ for index, case in enumerate( self.cases ): if str_value == case.value: return index - raise Exception( "No case matched value:", self.name, str_value ) + raise ValueError( "No case matched value:", self.name, str_value ) def value_to_basic( self, value, app ): rval = dict() current_case = rval['__current_case__'] = value['__current_case__'] 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