web.py 文件源码

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

项目:mopidy-auto 作者: gotling 项目源码 文件源码
def post(self):
        to = self.get_body_argument("to", False)

        if to:
            destination_uri = os.path.join(self.config['auto']['base_path'], to)
            destination_path = urllib.url2pathname(urlparse.urlparse(destination_uri.split('file://')[1]).path)

            logger.info("Moving '{}' to '{}'".format(self.album_path, destination_path))

            self.core.tracklist.clear()
            try:
                shutil.move(self.album_path, destination_path)
                logger.info("Moved album '{}' to '{}'".format(self.album_path, destination_path))
            except shutil.Error:
                logger.error("Could not move album '{}' to '{}'".format(self.album_path, destination_path), exc_info=1)
        else:
            logger.error('Destination not supplied, move canceled')

        return self.redirect('/auto')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号