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


Python EntryID.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self, infile=None, files=None):
        if infile is None:
            if files is None:
                files = Files()
            infile = files.get_value("PIO_SPEC_FILE")

        EntryID.__init__(self, infile)
开发者ID:Katetc,项目名称:cime,代码行数:9,代码来源:pio.py

示例2: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self, infile=None):
        """
        initialize an object
        """
        if infile is None:
            files = Files()
            infile = files.get_value("CONFIG_DRV_FILE")

        EntryID.__init__(self,infile)
开发者ID:quantheory,项目名称:cime,代码行数:11,代码来源:component.py

示例3: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self):
        """
        initialize an object

        >>> files = Files()
        >>> files.get_value('CASEFILE_HEADERS',resolved=False)
        '$CIMEROOT/cime_config/config_headers.xml'
        """
        infile = os.path.join(get_cime_root(), "cime_config", get_model(), "config_files.xml")
        EntryID.__init__(self, infile)
开发者ID:ekluzek,项目名称:cime,代码行数:12,代码来源:files.py

示例4: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self, infile):
        """
        initialize an object
        """
        files = Files()
        schema = None
        # not checking schema on external components yet
        cimeroot = get_cime_root()
        if  cimeroot in os.path.abspath(infile):
            schema = files.get_schema("CONFIG_DRV_FILE")

        EntryID.__init__(self, infile, schema=schema)
开发者ID:mnlevy1981,项目名称:cime,代码行数:14,代码来源:component.py

示例5: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self,infile=None):
        """
        initialize an object

        >>> files = Files()
        >>> files.get_value('CASEFILE_HEADERS',resolved=False)
        '$CIMEROOT/config/config_headers.xml'
        """
        if infile is None:
            files = Files()
            infile = files.get_value('CASEFILE_HEADERS', resolved=True)
        EntryID.__init__(self, infile)
开发者ID:apcraig,项目名称:cime,代码行数:14,代码来源:headers.py

示例6: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self):
        """
        initialize an object

        >>> files = Files()
        >>> files.get_value('CASEFILE_HEADERS',resolved=False)
        '$CIMEROOT/config/config_headers.xml'
        """
        cimeroot = get_cime_root()
        infile = os.path.join(cimeroot, "config", get_model(), "config_files.xml")
        expect(os.path.isfile(infile), "Could not find or open file {}".format(infile))
        schema = os.path.join(cimeroot, "config", "xml_schemas", "entry_id.xsd")
        EntryID.__init__(self, infile, schema=schema)
开发者ID:apcraig,项目名称:cime,代码行数:15,代码来源:files.py

示例7: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self, case_root, infile):
        if case_root is None:
            case_root = os.getcwd()

        if os.path.isabs(infile):
            fullpath = infile
        else:
            fullpath = os.path.join(case_root, infile)

        EntryID.__init__(self, fullpath)
        if not os.path.isfile(fullpath):
            headerobj = Headers()
            headernode = headerobj.get_header_node(os.path.basename(fullpath))
            self.root.append(headernode)
开发者ID:cacraigucar,项目名称:cime-cacraig,代码行数:16,代码来源:env_base.py

示例8: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self, infile, comp_class):
        """
        initialize a Component obect from the component xml file in infile
        associate the component class with comp_class if provided.
        """
        self._comp_class = comp_class
        if infile == 'testingonly':
            self.filename = infile
            return
        files = Files()
        schema = None
        EntryID.__init__(self, infile)
        schema = files.get_schema("CONFIG_{}_FILE".format(comp_class), attributes={"version":"{}".format(self.get_version())})

        if schema is not None:
            self.validate_xml_file(infile, schema)
开发者ID:fischer-ncar,项目名称:cime,代码行数:18,代码来源:component.py

示例9: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self, case_root, infile, schema=None, read_only=False):
        if case_root is None:
            case_root = os.getcwd()

        if os.path.isabs(infile):
            fullpath = infile
        else:
            fullpath = os.path.join(case_root, infile)

        EntryID.__init__(self, fullpath, schema=schema, read_only=read_only)

        self._id_map = None
        self._group_map = None

        if not os.path.isfile(fullpath):
            headerobj = Headers()
            headernode = headerobj.get_header_node(os.path.basename(fullpath))
            self.add_child(headernode)
        else:
            self._setup_cache()
开发者ID:fischer-ncar,项目名称:cime,代码行数:22,代码来源:env_base.py

示例10: __init__

# 需要导入模块: from CIME.XML.entry_id import EntryID [as 别名]
# 或者: from CIME.XML.entry_id.EntryID import __init__ [as 别名]
    def __init__(self):
        """
        initialize an object

        >>> files = Files()
        >>> files.get_value('CASEFILE_HEADERS',resolved=False)
        '$CIMEROOT/config/config_headers.xml'
        """
        cimeroot = get_cime_root()
        infile = os.path.join(cimeroot, "config", get_model(), "config_files.xml")
        expect(os.path.isfile(infile), "Could not find or open file {}".format(infile))
        schema = os.path.join(cimeroot, "config", "xml_schemas", "entry_id.xsd")
        EntryID.__init__(self, infile, schema=schema)
        config_files_override = os.path.join(os.path.dirname(cimeroot),".config_files.xml")
        # variables COMP_ROOT_DIR_{} are mutable, all other variables are read only
        self.COMP_ROOT_DIR = {}

        # .config_file.xml at the top level may overwrite COMP_ROOT_DIR_ nodes in config_files

        if os.path.isfile(config_files_override):
            self.read(config_files_override)
            self.overwrite_existing_entries()
开发者ID:Katetc,项目名称:cime,代码行数:24,代码来源:files.py


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