navigation.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:spoppy 作者: sindrig 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号