def __init__(self, case_root=None, infile="env_archive.xml"): """ initialize an object interface to file env_archive.xml in the case directory """ logger.debug("Case_root = %s" , case_root) # Check/Build path to env_archive.xml if case_root is None: case_root = os.getcwd() if os.path.isabs(infile): fullpath = infile else: fullpath = os.path.join(case_root, infile) # Initialize self # If env_archive.xml file does not exists in case directory read default from config GenericXML.__init__(self, fullpath) # The following creates the CASEROOT/env_archive.xml contents in self.root if not os.path.isfile(fullpath): headerobj = Headers() headernode = headerobj.get_header_node(os.path.basename(fullpath)) self.root.append(headernode) archive = Archive() self.root.append(archive.root)
def __init__(self, case_root=None, infile="env_archive.xml"): """ initialize an object interface to file env_archive.xml in the case directory """ logger.debug("Case_root = %s", case_root) # Check/Build path to env_archive.xml if case_root is None: case_root = os.getcwd() if os.path.isabs(infile): fullpath = infile else: fullpath = os.path.join(case_root, infile) # Initialize self # If env_archive.xml file does not exists in case directory read default from config GenericXML.__init__(self, fullpath) # The following creates the CASEROOT/env_archive.xml contents in self.root if not os.path.isfile(fullpath): headerobj = Headers() headernode = headerobj.get_header_node(os.path.basename(fullpath)) self.root.append(headernode) archive = Archive() self.root.append(archive.root)
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)
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()
def __init__(self, case_root=None, infile="env_archive.xml"): """ initialize an object interface to file env_archive.xml in the case directory """ logger.debug("Case_root = {}".format(case_root)) # Check/Build path to env_archive.xml if case_root is None: case_root = os.getcwd() if os.path.isabs(infile): fullpath = infile else: fullpath = os.path.join(case_root, infile) schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_archive.xsd") GenericXML.__init__(self, fullpath, schema=schema) # The following creates the CASEROOT/env_archive.xml contents in self.root if not os.path.isfile(fullpath): headerobj = Headers() headernode = headerobj.get_header_node(os.path.basename(fullpath)) self.add_child(headernode)
def __init__(self, case_root=None, infile="env_archive.xml"): """ initialize an object interface to file env_archive.xml in the case directory """ logger.debug("Case_root = {}".format(case_root)) # Check/Build path to env_archive.xml if case_root is None: case_root = os.getcwd() if os.path.isabs(infile): fullpath = infile else: fullpath = os.path.join(case_root, infile) schema = os.path.join(get_cime_root(), "config", "xml_schemas", "env_archive.xsd") GenericXML.__init__(self, fullpath, schema=schema) # The following creates the CASEROOT/env_archive.xml contents in self.root if not os.path.isfile(fullpath): headerobj = Headers() headernode = headerobj.get_header_node(os.path.basename(fullpath)) self.root.append(headernode)