def handle_new_destinations(self, locations):
"""Update the destination list when the ship can move to new places"""
self.listwalker.clear()
self.keypress_map = IndexedMenuEnumerator()
#for idx, location in enumerate(locations):
for location in locations:
prefix = self.keypress_map.set_next(location)
button = IndexedMenuButton('({}) {}'.format(prefix, location))
self.listwalker.append(urwid.AttrMap(button, None, focus_map='reversed'))
urwid.connect_signal(button, 'click', partial(self.handle_button_click, location))
评论列表
文章目录