dbupgrade.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def _extract_django16_south_maas19(cls):
        """Extract the django16, south, and MAAS 1.9 source code in to a temp
        path."""
        path_to_tarball = cls._path_to_django16_south_maas19()
        tempdir = tempfile.mkdtemp(prefix='maas-upgrade-')
        subprocess.check_call([
            "tar", "zxf", path_to_tarball, "-C", tempdir])

        settings_json = os.path.join(tempdir, "maas19settings.json")
        with open(settings_json, "w", encoding="utf-8") as fd:
            fd.write(json.dumps({"DATABASES": settings.DATABASES}))

        script_path = os.path.join(tempdir, "migrate.py")
        with open(script_path, "wb") as fp:
            fp.write(MAAS_UPGRADE_SCRIPT.encode("utf-8"))
        return tempdir, script_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号