def save_recent_project(self, proj):
        recent_file_path = get_data_file_path('files/recent_files.txt')
        max_length = MAX_RECENT
        recent_files = []
        if os.path.exists(recent_file_path):
            recent_files = codecs.open(recent_file_path, encoding='utf-8').read().split(u'\n')
        try:
            recent_files.remove(proj)
        except __HOLE__:
            pass
        recent_files.append(proj)
        with codecs.open(recent_file_path, 'w+', encoding='utf-8') as f:
            for recent_file in recent_files[-max_length:]:
                if recent_file and os.path.exists(recent_file):
                    f.write(u'{}\n'.format(recent_file))
dataset/ETHPy150Open jyapayne/Web2Executable/main.py/MainWindow.save_recent_project