(self, filepath)
Overwrite an existing file
Overwrite an existing file
Overwrite an existing file
def overwrite_file(self, filepath):
        '''Overwrite an existing file'''

        self.control.draw_text(self.changed,
                               (1, 0, 'File exists. Overwrite? [y/(n)]'))
        while True:
            try:
                c = self.control.stdscr.getch()
            except KeyboardInterrupt:
                c = 4
            if c == ord('y'):
                if self.save(filepath) is not False:
                    return True
                else:
                    return False
            elif c == 4:
                self.close()
            elif c == cur.KEY_RESIZE:
                self.control.resize_all()
            else:
                return False
def overwrite_file ( self , filepath ) : self . control . draw_text ( self . changed , ( 1 , 0 , 'File exists. Overwrite? [y/(n)]' ) ) while True : try : c = self . control . stdscr . getch ( ) except KeyboardInterrupt : c = 4 if c == ord ( 'y' ) : if self . save ( filepath ) is not False : return True else : return False elif c == 4 : self . close ( ) elif c == cur . KEY_RESIZE : self . control . resize_all ( ) else : return False