#NEWLINE# def execute( self , ns , caption , device_name ) : #NEWLINE# #INDENT# setting = get_setting_by_caption ( ns , caption ) #NEWLINE# if ( device_name is None ) : #NEWLINE# #INDENT# raise errors . LmiFailed ( ( 'No such setting: %s' % caption ) ) #NEWLINE# #UNINDENT# device = None #NEWLINE# if ( device_name is not None ) : #NEWLINE# #INDENT# device = get_device_by_name ( ns , device_name ) #NEWLINE# if ( device is None ) : #NEWLINE# #INDENT# raise errors . LmiFailed ( ( 'No such device: %s' % device_name ) ) #NEWLINE# #UNINDENT# #UNINDENT# if get_autoconnect ( ns , setting , device ) : #NEWLINE# #INDENT# ( yield ( ( 'Setting %s is automatically activated' % caption ) , ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( yield ( ( 'Setting %s is not automatically activated' % caption ) , ) )