本文整理匯總了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)