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


Python IMProvNode.makeDOMElement方法代码示例

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


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

示例1: addStageOutNode

# 需要导入模块: from IMProv.IMProvNode import IMProvNode [as 别名]
# 或者: from IMProv.IMProvNode.IMProvNode import makeDOMElement [as 别名]
def addStageOutNode(cmsRunNode, nodeName, *nodes):
    """
    _addStageOutNode_

    Given a cmsRun Node add a StageOut node to it with the name provided

    """
    if not nodes:
        nodes = [cmsRunNode.name]
    stageOut = cmsRunNode.newNode(nodeName)
    stageOut.type = "StageOut"
    stageOut.application["Project"] = ""
    stageOut.application["Version"] = ""
    stageOut.application["Architecture"] = ""
    stageOut.application["Executable"] = "RuntimeStageOut.py" # binary name


    config = IMProvNode("StageOutConfiguration")
    for node in nodes:
        config.addNode(IMProvNode("StageOutFor", None, NodeName = str(node)))

    config.addNode(IMProvNode("NumberOfRetries", None, Value = 3))
    config.addNode(IMProvNode("RetryPauseTime", None, Value = 600))



    stageOut.configuration = config.makeDOMElement().toprettyxml()
    return
开发者ID:PerilousApricot,项目名称:CRAB2,代码行数:30,代码来源:WorkflowTools.py

示例2: persistRuns

# 需要导入模块: from IMProv.IMProvNode import IMProvNode [as 别名]
# 或者: from IMProv.IMProvNode.IMProvNode import makeDOMElement [as 别名]
def persistRuns(filename, *runTables):
    """
    _persistRuns_

    Util to save a list of RunTable instances to a file

    """
    topNode = IMProvNode("Runs")
    [ topNode.addNode(x.save()) for x in runTables ]

    handle = open(filename, 'w')
    handle.write(topNode.makeDOMElement().toprettyxml())
    handle.close()
    return
开发者ID:TonyWildish,项目名称:CSA06-T0-prototype,代码行数:16,代码来源:RunTable.py

示例3: createLogCollectorJobSpec

# 需要导入模块: from IMProv.IMProvNode import IMProvNode [as 别名]
# 或者: from IMProv.IMProvNode.IMProvNode import makeDOMElement [as 别名]
def createLogCollectorJobSpec(workflowSpec, originalWf, site, lfnBase, stageOutParams, *lfns):
    """
    createLogCollectorJobSpec

    Create a LogArchive JobSpec definition, using the LogArchive
    workflow template, site name and the list of LFNs to be
    removed

    """

    jobSpec = workflowSpec.createJobSpec()
    jobName = "%s-%s" % (workflowSpec.workflowName(), makeUUID())
    jobSpec.setJobName(jobName)
    jobSpec.setJobType("LogCollect")

    jobSpec.addWhitelistSite(site)

    confNode = IMProvNode("LogCollectorConfig")

    # add site and workflow to collect
    confNode.addNode(IMProvNode("wf", originalWf))
    confNode.addNode(IMProvNode("se", site))
    confNode.addNode(IMProvNode("lfnBase", lfnBase))

    # add logs to collect
    logNode = IMProvNode("LogsToCollect")
    for lfn in lfns:
        logNode.addNode(IMProvNode("lfn", lfn))

    confNode.addNode(logNode)

    # stageout
    if stageOutParams:
        stageOutNode = IMProvNode("Override")
        #    WorkflowTools.addStageOutOverride(confNode, stageOutParams['command'],
        #                                      stageOutParams['option'],
        #                                      stageOutParams['se-name'],
        #                                      stageOutParams['lfnPrefix'])

        stageOutNode.addNode(IMProvNode("command", stageOutParams["command"]))
        stageOutNode.addNode(IMProvNode("option", stageOutParams["option"]))
        stageOutNode.addNode(IMProvNode("se-name", stageOutParams["se-name"]))
        stageOutNode.addNode(IMProvNode("lfn-prefix", stageOutParams["lfnPrefix"]))
        confNode.addNode(stageOutNode)

    # jobSpec.payload.configuration = logNode.makeDOMElement().toprettyxml()
    jobSpec.payload.configuration = confNode.makeDOMElement().toprettyxml()

    return jobSpec
开发者ID:jlexternal,项目名称:WPrime13TeV,代码行数:51,代码来源:LogCollectorTools.py

示例4: addStageOutOverride

# 需要导入模块: from IMProv.IMProvNode import IMProvNode [as 别名]
# 或者: from IMProv.IMProvNode.IMProvNode import makeDOMElement [as 别名]
def addStageOutOverride(stageOutNode, command, option, seName, lfnPrefix):
    """
    _addStageOutOverride_

    Given the stageout node provided, add an Override to its configuration
    attribute

    """
    if len(stageOutNode.configuration.strip()) == 0:
        config = IMProvNode("StageOutConfiguration")
    else:
        config = loadIMProvString(stageOutNode.configuration)

    override = IMProvNode("Override")
    override.addNode(IMProvNode("command", command))
    override.addNode(IMProvNode("option" , option))
    override.addNode(IMProvNode("se-name" , seName))
    override.addNode(IMProvNode("lfn-prefix", lfnPrefix))
    config.addNode(override)
    stageOutNode.configuration = config.makeDOMElement().toprettyxml()
    return
开发者ID:PerilousApricot,项目名称:CRAB2,代码行数:23,代码来源:WorkflowTools.py


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