当前位置: 首页>>代码示例>>Python>>正文


Python Environment.get_release_api_version方法代码示例

本文整理汇总了Python中pyasm.common.Environment.get_release_api_version方法的典型用法代码示例。如果您正苦于以下问题:Python Environment.get_release_api_version方法的具体用法?Python Environment.get_release_api_version怎么用?Python Environment.get_release_api_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasm.common.Environment的用法示例。


在下文中一共展示了Environment.get_release_api_version方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from pyasm.common import Environment [as 别名]
# 或者: from pyasm.common.Environment import get_release_api_version [as 别名]
def main():

    install_dir = tacticenv.get_install_dir()
    version = Environment.get_release_version()
    api_version = Environment.get_release_api_version()

    client_api_dir = '%s/src/client' % install_dir
    context_client_dir = '%s/src/context/client' % install_dir

    print "install: ", install_dir
    print "version: ", version

    # copy scm directory in api
    scm_dir = "%s/src/tactic/scm" % install_dir
    client_dir = "%s/src/client" % install_dir
    to_scm_dir = "%s/src/client/tactic_client_lib/scm" % install_dir
    if os.path.exists(to_scm_dir):
        shutil.rmtree(to_scm_dir)
    shutil.copytree(scm_dir, to_scm_dir)


    # create the client api zip package into context/client dir
    path = "%s/src/context/client/tactic-api-%s.zip" % (install_dir, api_version)
    if os.path.exists(path):
        os.system('''rm "%s"''' % path)
    os.system('''cd "%s"; zip -r "%s" "tactic_client_lib"''' % (client_api_dir, path) )




    # copy the client api into the standalone minimal python
    from_dir = '%s/src/client/tactic_client_lib' % install_dir
    python = '%s/src/client/python-3.6.6-win32-minimal' % install_dir
    to_dir = '%s/Lib/site-packages/tactic_client_lib' % python
    if os.path.exists(to_dir):
        shutil.rmtree(to_dir)
    shutil.copytree(from_dir, to_dir)

    # copy and rename to the api version
    to_name = "tactic-api-python-%s" % api_version
    to_dir = os.path.dirname(python) + "/" + to_name;
    if os.path.exists(to_dir):
        shutil.rmtree(to_dir)
    shutil.copytree(python, to_dir)

    # zip this up
    to_dir = os.path.dirname(python)
    zip_path = "%s/%s.zip" % (to_dir, to_name)
    if os.path.exists(zip_path):
        os.unlink(zip_path)
    os.system('''cd "%s"; zip -r "%s.zip" "%s"''' % (to_dir, to_name, to_name) )
    shutil.rmtree("%s/%s" % (to_dir, to_name) )

    #
    final_path = "%s/%s.zip" % (context_client_dir, to_name)
    if os.path.exists(final_path):
        os.unlink(final_path)
    print(zip_path, final_path)
    shutil.move(zip_path, final_path)
开发者ID:0-T-0,项目名称:TACTIC,代码行数:61,代码来源:package_api.py


注:本文中的pyasm.common.Environment.get_release_api_version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。