<s> from __future__ import division <EOL> import copy <EOL> from vistrails . db . versions . v0_9_5 . domain import DBVistrail , DBWorkflow , DBLog , DBRegistry , DBModuleExec <EOL> def translateVistrail ( _vistrail ) : <EOL> def update_signature ( old_obj , translate_dict ) : <EOL> return old_obj . db_spec <EOL> def update_optional ( old_obj , translate_dict ) : <EOL> return <NUM_LIT:0> <EOL> def update_sort_key ( old_obj , translate_dict ) : <EOL> return - <NUM_LIT:1> <EOL> def update_sigstring ( old_obj , translate_dict ) : <EOL> return old_obj . db_spec <EOL> def update_workflow ( old_obj , translate_dict ) : <EOL> return DBWorkflow . update_version ( old_obj . db_workflow , translate_dict ) <EOL> translate_dict = { '<STR_LIT>' : { '<STR_LIT>' : update_sigstring , <EOL> '<STR_LIT>' : update_optional , <EOL> '<STR_LIT>' : update_sort_key } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : update_signature } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : update_workflow } } <EOL> vistrail = DBVistrail . update_version ( _vistrail , translate_dict ) <EOL> vistrail . db_version = '<STR_LIT>' <EOL> return vistrail <EOL> def translateWorkflow ( _workflow ) : <EOL> def update_signature ( old_obj , translate_dict ) : <EOL> return old_obj . db_spec <EOL> def update_optional ( old_obj , translate_dict ) : <EOL> return <NUM_LIT:0> <EOL> def update_sort_key ( old_obj , translate_dict ) : <EOL> return - <NUM_LIT:1> <EOL> def update_sigstring ( old_obj , translate_dict ) : <EOL> return old_obj . db_spec <EOL> def update_workflow ( old_obj , translate_dict ) : <EOL> return DBWorkflow . update_version ( old_obj . db_workflow , translate_dict ) <EOL> translate_dict = { '<STR_LIT>' : { '<STR_LIT>' : update_sigstring , <EOL> '<STR_LIT>' : update_optional , <EOL> '<STR_LIT>' : update_sort_key } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : update_signature } , <EOL> '<STR_LIT>' : { '<STR_LIT>' : update_workflow } } <EOL> workflow = DBWorkflow . update_version ( _workflow , translate_dict ) <EOL> workflow . db_version = '<STR_LIT>' <EOL> return workflow <EOL> def translateLog ( _log ) : <EOL> def update_items ( old_obj , translate_dict ) : <EOL> new_items = [ ] <EOL> for obj in old_obj . db_module_execs : <EOL> new_items . append ( DBModuleExec . update_version ( obj , translate_dict ) ) <EOL> return new_items <EOL> translate_dict = { '<STR_LIT>' : { '<STR_LIT>' : update_items } } <EOL> log = DBLog . update_version ( _log , translate_dict ) <EOL> log . db_version = '<STR_LIT>' <EOL> return log <EOL> def translateRegistry ( _registry ) : <EOL> translate_dict = { } <EOL> registry = DBRegistry . update_version ( _registry , translate_dict ) <EOL> registry . db_version = '<STR_LIT>' <EOL> return registry </s>
