Exemplo n.º 1
0
    def update_annotations(old_obj, trans_dict):
        new_annotations = []
        for a in old_obj.db_annotations:
            new_annotations.append(DBAnnotation.update_version(a, 
                                                               translate_dict))
            id_scope.updateBeginId(DBAnnotation.vtType, a.db_id)
        vars = {}
        for var in old_obj.db_vistrailVariables:
            descriptor = (var.db_package, var.db_module, var.db_namespace)
            vars[var.db_name] = (var.db_uuid, descriptor, var.db_value)
        if vars:
            new_id = id_scope.getNewId(DBAnnotation.vtType)
            annotation = DBAnnotation(id=new_id, key='__vistrail_vars__', 
                                      value=str(vars))
            new_annotations.append(annotation)

        return new_annotations
Exemplo n.º 2
0
 def update_annotations(old_obj, translate_dict):
     same_annotations = []
     for annotation in old_obj.db_annotations:
         if annotation.db_key == "__notes__":
             notes_annotations.append((old_obj.db_id, annotation.db_value, annotation.db_id))
         elif annotation.db_key == "__thumb__":
             thumb_annotations.append((old_obj.db_id, annotation.db_value, annotation.db_id))
         elif annotation.db_key == "__upgrade__":
             upgrade_annotations.append((old_obj.db_id, annotation.db_value, annotation.db_id))
         else:
             same_annotations.append(DBAnnotation.update_version(annotation, translate_dict))
     return same_annotations
Exemplo n.º 3
0
 def update_annotations(old_obj, translate_dict):
     same_annotations = []
     for annotation in old_obj.db_annotations:
         if annotation.db_key == '__notes__':
             notes_annotations.append(
                 (old_obj.db_id, annotation.db_value, annotation.db_id))
         elif annotation.db_key == '__thumb__':
             thumb_annotations.append(
                 (old_obj.db_id, annotation.db_value, annotation.db_id))
         elif annotation.db_key == '__upgrade__':
             upgrade_annotations.append(
                 (old_obj.db_id, annotation.db_value, annotation.db_id))
         else:
             same_annotations.append(
                 DBAnnotation.update_version(annotation, translate_dict))
     return same_annotations