#NEWLINE# def _default_by_analysis( self , node_id , plan , exceptions = None ) : #NEWLINE# #INDENT# if ( exceptions is None ) : #NEWLINE# #INDENT# exceptions = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# node = self . _model_get_by_id ( 'nodes' , node_id ) #NEWLINE# new_plan = [ ] #NEWLINE# for step in plan : #NEWLINE# #INDENT# new_plan_step = { #NEWLINE# #INDENT# 'primitive' : step [ 'primitive' ] , #NEWLINE# 'ns' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# primitive = step [ 'primitive' ] #NEWLINE# if ( not ( '.' in primitive ) ) : #NEWLINE# #INDENT# actions = node [ 'attrs' ] . get ( 'opencenter_agent_actions' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( primitive in actions ) : #NEWLINE# #INDENT# prim = actions [ primitive ] #NEWLINE# for arg in prim [ 'args' ] : #NEWLINE# #INDENT# if ( arg in exceptions ) : #NEWLINE# #INDENT# new_plan_step [ 'ns' ] [ arg ] = exceptions [ arg ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'default' in prim [ 'args' ] [ arg ] ) : #NEWLINE# #INDENT# new_plan_step [ 'ns' ] [ arg ] = prim [ 'args' ] [ arg ] [ 'default' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# new_plan . append ( new_plan_step ) #NEWLINE# #UNINDENT# return new_plan