details: http://www.bx.psu.edu/hg/galaxy/rev/23fb19105d96 changeset: 3609:23fb19105d96 user: Dan Blankenberg <dan@bx.psu.edu> date: Mon Apr 05 13:57:19 2010 -0400 description: Fix a bug where using repeat grouping constructs and change_format tags or output data label templates in a tool would cause a JSON server error. Lists were not being properly psuedo-deepcopied before being wrapped for usage. diffstat: lib/galaxy/tools/actions/__init__.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diffs (31 lines): diff -r 59645595001f -r 23fb19105d96 lib/galaxy/tools/actions/__init__.py --- a/lib/galaxy/tools/actions/__init__.py Fri Apr 02 17:29:15 2010 -0400 +++ b/lib/galaxy/tools/actions/__init__.py Mon Apr 05 13:57:19 2010 -0400 @@ -107,14 +107,27 @@ Makes a copy of input dictionary from_dict such that all values that are dictionaries result in creation of a new dictionary ( a sort of deepcopy ). We may need to handle other complex types ( e.g., lists, etc ), but not sure... + Yes, we need to handle lists (and now are)... """ copy_from_dict = {} for key, value in from_dict.items(): if type( value ).__name__ == 'dict': copy_from_dict[ key ] = make_dict_copy( value ) + elif isinstance( value, list ): + copy_from_dict[ key ] = make_list_copy( value ) else: copy_from_dict[ key ] = value return copy_from_dict + def make_list_copy( from_list ): + new_list = [] + for value in from_list: + if isinstance( value, dict ): + new_list.append( make_dict_copy( value ) ) + elif isinstance( value, list ): + new_list.append( make_list_copy( value ) ) + else: + new_list.append( value ) + return new_list def wrap_values( inputs, input_values ): # Wrap tool inputs as necessary for input in inputs.itervalues():