#NEWLINE# def cmd_activate( ns , caption , device_name ) : #NEWLINE# #INDENT# setting = get_setting_by_caption ( ns , caption ) #NEWLINE# if ( setting is None ) : #NEWLINE# #INDENT# raise errors . LmiFailed ( ( 'No such setting: %s' % caption ) ) #NEWLINE# #UNINDENT# if device_name : #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# else : #NEWLINE# #INDENT# device = None #NEWLINE# #UNINDENT# return activate ( caption , setting , device )