scatest.py 文件源码

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

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
def createTestDomain():
    domainName = getTestDomainName()
    print domainName

    domainPath = os.path.join(getSdrPath(), "dom", "domain")
    templatePath = os.path.join(getSdrPath(), "templates", "domain")
    # Create a test domain
    if os.path.isdir(domainPath):
        shutil.rmtree(domainPath)
    # Copy the template over
    shutil.copytree(templatePath, domainPath)
    # Open the DMD file and replace the name, using a very naive method
    dmd = open(os.path.join(domainPath, "DomainManager.dmd.xml"), "r")
    lines = dmd.read()
    dmd.close()
    lines = lines.replace("${DOMAINNAME}", domainName)
    dmd = open(os.path.join(domainPath, "DomainManager.dmd.xml"), "w+")
    dmd.write(lines)
    dmd.close()

    setupDeviceAndDomainMgrPackage()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号