本文整理汇总了Python中CIME.XML.env_base.EnvBase.get_children方法的典型用法代码示例。如果您正苦于以下问题:Python EnvBase.get_children方法的具体用法?Python EnvBase.get_children怎么用?Python EnvBase.get_children使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIME.XML.env_base.EnvBase
的用法示例。
在下文中一共展示了EnvBase.get_children方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_children
# 需要导入模块: from CIME.XML.env_base import EnvBase [as 别名]
# 或者: from CIME.XML.env_base.EnvBase import get_children [as 别名]
def get_children(self, name=None, attributes=None, root=None):
if name in ("JOB_WALLCLOCK_TIME", "PROJECT", "CHARGE_ACCOUNT",
"PROJECT_REQUIRED", "JOB_QUEUE", "BATCH_COMMAND_FLAGS"):
nodes = EnvBase.get_children(self, "entry", attributes={"id":name}, root=root)
else:
nodes = EnvBase.scan_children(self, name, attributes=attributes, root=root)
return nodes
示例2: create_job_groups
# 需要导入模块: from CIME.XML.env_base import EnvBase [as 别名]
# 或者: from CIME.XML.env_base.EnvBase import get_children [as 别名]
def create_job_groups(self, batch_jobs):
# Subtle: in order to support dynamic batch jobs, we need to remove the
# job_submission group and replace with job-based groups
orig_group = self.get_child("group", {"id":"job_submission"},
err_msg="Looks like job groups have already been created")
orig_group_children = EnvBase.get_children(self, root=orig_group)
childnodes = []
for child in reversed(orig_group_children):
childnodes.append(child)
self.remove_child(orig_group)
for name, jdict in batch_jobs:
new_job_group = self.make_child("group", {"id":name})
for field in jdict.keys():
val = jdict[field]
node = self.make_child("entry", {"id":field,"value":val}, root=new_job_group)
self.make_child("type", root=node, text="char")
for child in childnodes:
self.add_child(self.copy(child), root=new_job_group)