def navigate_to(self, going):
logger.debug('navigating to: %s' % going)
self.session.process_events()
going.initialize()
while self.navigating:
self.check_spotipy_me()
click.clear()
self.print_header()
self.print_menu(going.get_ui())
response = going.get_response()
if callable(response):
response = response()
logger.debug('Got response %s after evaluation' % response)
if response == responses.QUIT:
click.clear()
click.echo('Thanks, bye!')
self.navigating = False
return
elif response == responses.UP:
break
elif response == responses.NOOP:
continue
elif response == responses.PLAYER:
self.navigate_to(self.player)
elif response != going:
self.navigate_to(response)
# This happens when the `going` instance gets control again. We
# don't want to remember the query and we want to rebuild the
# menu's options
# (and possibly something else?)
going.initialize()
评论列表
文章目录