web.py 文件源码

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

项目:mopidy-auto 作者: gotling 项目源码 文件源码
def initialize(self, core, config):
        self.core = core
        self.config = config

        # Store path of currently playing album
        track = self.core.playback.get_current_track().get()
        if track:
            track_path = urllib.url2pathname(urlparse.urlparse(track.uri.split('file://')[1]).path)
            self.album_path = os.path.dirname(track_path)
        else:
            return self.redirect('/auto')

        # Read all section config to an array. Ready for dynamic amount of sections
        self.sections = []
        section = 0

        exists = "s{}_folder".format(section) in self.config['auto']
        while exists:
            self.sections.append({
                "start": self.config['auto']["s{}_start".format(section)],
                "folder": self.config['auto']["s{}_folder".format(section)],
                "max_volume": self.config['auto']["s{}_max_volume".format(section)]
            })
            section += 1
            exists = "s{}_folder".format(section) in self.config['auto']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号