def load(): """ A menu for selectng a save to load. """ saves_list = saves.list_saves() return menu( 'Load save', ([(save[1]['name'], lambda_gen(saves.load_save, save[0])) for save in saves_list] + [back]) )
def delete(): """ A menu for selectng a save to delete. """ saves_list = saves.list_saves() return menu( 'Delete save', ([(save[1]['name'], lambda_gen(saves.delete_save, save[0])) for save in saves_list] + [back]) )
def saves_list(func): saves_list = saves.list_saves() return ([(save[1]['name'], lambda_gen(func, save[0])) for save in saves_list] + [() if saves_list else None])