#NEWLINE# def cmd_set_autoconnect( ns , caption , device_name , enable ) : #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# 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# return set_autoconnect ( ns , setting , device , enable )