#NEWLINE# def remove( name = None , index = None ) : #NEWLINE# #INDENT# '\n    remove the specified configuration\n\n    ' #NEWLINE# removed = False #NEWLINE# count = 1 #NEWLINE# for configuration in _CONFIG . sections ( ) : #NEWLINE# #INDENT# if ( index != None ) : #NEWLINE# #INDENT# if ( count == index ) : #NEWLINE# #INDENT# _CONFIG . remove_section ( configuration ) #NEWLINE# removed = True #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if ( name != None ) : #NEWLINE# #INDENT# if ( configuration == name ) : #NEWLINE# #INDENT# _CONFIG . remove_section ( configuration ) #NEWLINE# removed = True #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# count += 1 #NEWLINE# #UNINDENT# if ( not removed ) : #NEWLINE# #INDENT# raise JutException ( ( 'Unable to find %s configuration' % name ) ) #NEWLINE# #UNINDENT# with open ( _CONFIG_FILEPATH , 'w' ) as configfile : #NEWLINE# #INDENT# _CONFIG . write ( configfile )