本文整理汇总了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
示例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
示例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
示例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