本文整理汇总了Python中CIME.XML.files.Files.get_resolved_value方法的典型用法代码示例。如果您正苦于以下问题:Python Files.get_resolved_value方法的具体用法?Python Files.get_resolved_value怎么用?Python Files.get_resolved_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIME.XML.files.Files
的用法示例。
在下文中一共展示了Files.get_resolved_value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from CIME.XML.files import Files [as 别名]
# 或者: from CIME.XML.files.Files import get_resolved_value [as 别名]
def __init__(self, infile=None, files=None, machine=None):
"""
initialize an object
if a filename is provided it will be used,
otherwise if a files object is provided it will be used
otherwise create a files object from default values
"""
self.machine_node = None
self.machine = None
self.machines_dir = None
if infile is None:
if files is None:
files = Files()
infile = files.get_value("MACHINES_SPEC_FILE", resolved=False)
infile = files.get_resolved_value(infile)
self.machines_dir = os.path.dirname(infile)
GenericXML.__init__(self, infile)
# Append the contents of $HOME/.cime/config_machines.xml if it exists
# This could cause problems if node matchs are repeated when only one is expected
local_infile = os.path.join(os.environ.get("HOME"), ".cime", "config_machines.xml")
logger.debug("Infile: %s", local_infile)
if os.path.exists(local_infile):
GenericXML.read(self, local_infile)
if machine is None:
machine = self.probe_machine_name()
expect(machine is not None, "Could not initialize machine object from %s or %s" % (infile, local_infile))
self.set_machine(machine)
示例2: __init__
# 需要导入模块: from CIME.XML.files import Files [as 别名]
# 或者: from CIME.XML.files.Files import get_resolved_value [as 别名]
def __init__(self, machine, files=None, infile=None):
"""
initialize an object
"""
if (infile is None):
if files is None:
files = Files()
infile = files.get_value("LTARCHIVE_SPEC_FILE", resolved=False)
infile = files.get_resolved_value(infile)
GenericXML.__init__(self, infile)
self.machine = machine