forked from ESMCI/cime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostprocessing.py
32 lines (25 loc) · 1.08 KB
/
postprocessing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Interface to the config_postprocessing.xml file. This class inherits from EntryID
"""
from CIME.XML.standard_module_setup import *
from CIME.XML.entry_id import EntryID
from CIME.XML.files import Files
from CIME.utils import expect
logger = logging.getLogger(__name__)
class Postprocessing(EntryID):
def __init__(self, infile=None, files=None):
"""
initialize an object
"""
if files is None:
files = Files()
if infile is None:
infile = files.get_value("POSTPROCESSING_SPEC_FILE")
expect(infile, "No postprocessing file defined in {}".format(files.filename))
schema = files.get_schema("POSTPROCESSING_SPEC_FILE")
EntryID.__init__(self, infile, schema=schema)
# Append the contents of $HOME/.cime/config_postprocessing.xml if it exists
# This could cause problems if node matchs are repeated when only one is expected
infile = os.path.join(os.environ.get("HOME"), ".cime", "config_postprocessing.xml")
if os.path.exists(infile):
EntryID.read(self, infile)