#NEWLINE# def updateAliasesFromPipeline( self , pipeline ) : #NEWLINE# #INDENT# "updateAliasesFromPipeline(self, pipeline) -> long\n        This will generate a new mashup by updating the aliases of the current \n        mashup according to the aliases in a pipeline. This assumes that the \n        mashup's current aliases are different from pipeline aliases by at most \n        one change (eg., an alias rename, an alias addition, an alias removal)\n        \n        " #NEWLINE# pip_aliases = pipeline . aliases . keys ( ) #NEWLINE# mashup_aliases = [ a . name for a in self . currentMashup . alias_list ] #NEWLINE# new_aliases = [ ] #NEWLINE# if ( len ( pip_aliases ) == len ( mashup_aliases ) ) : #NEWLINE# #INDENT# old_a = None #NEWLINE# new_a = None #NEWLINE# for a in self . currentMashup . alias_list : #NEWLINE# #INDENT# if ( a . name not in pip_aliases ) : #NEWLINE# #INDENT# old_a = a . do_copy ( new_ids = True , id_scope = self . mshptrail . id_scope , id_remap = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# new_aliases . append ( old_a ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_aliases . append ( a ) #NEWLINE# #UNINDENT# #UNINDENT# for a in pip_aliases : #NEWLINE# #INDENT# if ( a not in mashup_aliases ) : #NEWLINE# #INDENT# new_a = ( a , pipeline . aliases [ a ] ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( old_a is not None ) and ( new_a is not None ) ) : #NEWLINE# #INDENT# ( a , info ) = new_a #NEWLINE# parameter = pipeline . db_get_object ( info [ 0 ] , info [ 1 ] ) #NEWLINE# old_a . name = a #NEWLINE# old_a . component . vttype = parameter . vtType #NEWLINE# old_a . component . vtid = parameter . real_id #NEWLINE# old_a . component . vtparent_type = info [ 2 ] #NEWLINE# old_a . component . vt_parent_id = info [ 3 ] #NEWLINE# old_a . component . mid = info [ 4 ] #NEWLINE# old_a . component . type = parameter . type #NEWLINE# old_a . component . val = parameter . strValue #NEWLINE# old_a . component . vtpos = parameter . pos #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( pip_aliases ) < len ( mashup_aliases ) ) : #NEWLINE# #INDENT# pos = 0 #NEWLINE# for a in self . currentMashup . alias_list : #NEWLINE# #INDENT# if ( a . name in pip_aliases ) : #NEWLINE# #INDENT# alias = a . do_copy ( new_ids = True , id_scope = self . mshptrail . id_scope , id_remap = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# alias . component . pos = pos #NEWLINE# new_aliases . append ( alias ) #NEWLINE# pos += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# pos = len ( mashup_aliases ) #NEWLINE# new_aliases = [ a for a in self . currentMashup . alias_list ] #NEWLINE# for a in pip_aliases : #NEWLINE# #INDENT# if ( a not in mashup_aliases ) : #NEWLINE# #INDENT# info = pipeline . aliases [ a ] #NEWLINE# parameter = pipeline . db_get_object ( info [ 0 ] , info [ 1 ] ) #NEWLINE# cid = self . id_scope . getNewId ( 'mashup_component' ) #NEWLINE# aid = self . id_scope . getNewId ( 'mashup_alias' ) #NEWLINE# component = Component ( cid , parameter . vtType , parameter . real_id , info [ 2 ] , info [ 3 ] , info [ 4 ] , parameter . type , parameter . strValue , parameter . pos , pos , '' ) #NEWLINE# alias = Alias ( aid , a , component ) #NEWLINE# new_aliases . append ( alias ) #NEWLINE# pos += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return self . createMashupVersion ( new_aliases , quiet = False )