15 from dateutil
import parser
16 from datetime
import tzinfo, timedelta, datetime
21 import xml.dom.minidom
22 from xml.dom.minidom
import Node
32 l = glob.glob(dir +
'/*.xml')
34 filenameSplitted = os.path.split(i)[1].split(
'.')
35 id = filenameSplitted[0]
44 dom = xml.dom.minidom.parse(ficXML)
47 outputs = dom.getElementsByTagName(
'output')
48 for output
in outputs:
49 ret[
'datadir'] = output.getElementsByTagName(
'datadir')[0].firstChild.data
50 ret[
'exp'] = output.getElementsByTagName(
'exp')[0].firstChild.data
51 ret[
'type'] = output.getElementsByTagName(
'type')[0].firstChild.data
55 backgrounds = dom.getElementsByTagName(
'background')
56 for background
in backgrounds:
57 states = background.getElementsByTagName(
'state')
60 initials = dom.getElementsByTagName(
'initial')
61 for initial
in initials:
63 ret[
'background'] = bg
66 obsFiles = dom.getElementsByTagName(
'ObsFileIn')
67 ret[
'obsFileIn'] =
None 68 for obsFile
in obsFiles:
69 ret[
'obsFileIn'] = obsFile.firstChild.data
79 filename = node.getElementsByTagName(
'filename')[0].firstChild.data
80 date = node.getElementsByTagName(
'date')[0].firstChild.data
81 f1 = filename.split(
'/')
84 refTime = parser.parse(bg[2])
87 return bg[0] +
"." + bg[1], refTime
95 return self.
__map.keys()
101 return self.
__map[id][
'obsFileIn']
112 return f[
"exp"] +
"." + f[
"type"]
113 except ValueError, Argument:
122 return self.
__map[id][
'background']
def getBackground(self, id)
def getOutputFile(self, id)
def getFromXML(self, ficXML)
def getStateFromXML(self, node)