#NEWLINE# def create_extractor_config_file( self ) : #NEWLINE# #INDENT# config_filepath = os . path . join ( self . folder_path , 'extractor_config.json' ) #NEWLINE# def do_it( ) : #NEWLINE# #INDENT# with open ( config_filepath , 'w' ) as filehandler : #NEWLINE# #INDENT# json . dump ( defaults . extractor_config , filehandler , indent = 4 ) #NEWLINE# #UNINDENT# #UNINDENT# if self . creating : #NEWLINE# #INDENT# do_it ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( json . load ( open ( config_filepath ) ) != defaults . extractor_config ) : #NEWLINE# #INDENT# msg = 'Should we override your extraction config settings?' #NEWLINE# msg += ' (existing version will be backed up first)' #NEWLINE# if self . prompt ( msg ) : #NEWLINE# #INDENT# self . preserve_old_file_version_as_copy ( config_filepath ) #NEWLINE# do_it ( ) #NEWLINE# print ( 'Extraction configs upgraded.' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# print ( 'Extraction configs left untouched.' )