-
- """
- <?xml version='1.0' encoding='utf-8'?>
- <?xml-stylesheet type='text/xsl' href='job_report.xsl'?>
- <JobsReport>
- <infos>
- <info name="generated" value="2016-06-02 07:06:45"/>
- </infos>
- <hosts>
- <host name=is221553 port=22 distribution=UB12.04/>
- <host name=is221560 port=22/>
- <host name=is221553 port=22 distribution=FD20/>
- </hosts>
- <applications>
- <application name=SALOME-7.8.0/>
- <application name=SALOME-master/>
- <application name=MED-STANDALONE-master/>
- <application name=CORPUS/>
- </applications>
-
- <jobs>
- <job name="7.8.0 FD22">
- <host>is228809</host>
- <port>2200</port>
- <application>SALOME-7.8.0</application>
- <user>adminuser</user>
- <timeout>240</timeout>
- <commands>
- export DISPLAY=is221560
- scp -p salome@is221560.intra.cea.fr:/export/home/salome/SALOME-7.7.1p1-src.tgz /local/adminuser
- tar xf /local/adminuser/SALOME-7.7.1p1-src.tgz -C /local/adminuser
- </commands>
- <state>Not launched</state>
- </job>
-
- <job name="master MG05">
- <host>is221560</host>
- <port>22</port>
- <application>SALOME-master</application>
- <user>salome</user>
- <timeout>240</timeout>
- <commands>
- export DISPLAY=is221560
- scp -p salome@is221560.intra.cea.fr:/export/home/salome/SALOME-7.7.1p1-src.tgz /local/adminuser
- sat prepare SALOME-master
- sat compile SALOME-master
- sat check SALOME-master
- sat launcher SALOME-master
- sat test SALOME-master
- </commands>
- <state>Running since 23 min</state>
- <!-- <state>time out</state> -->
- <!-- <state>OK</state> -->
- <!-- <state>KO</state> -->
- <begin>10/05/2016 20h32</begin>
- <end>10/05/2016 22h59</end>
- </job>
-
- </jobs>
- </JobsReport>
-
- """
-
- def __init__(self, xml_file_path, l_jobs, l_jobs_not_today, stylesheet):
- # The path of the xml file
- self.xml_file_path = xml_file_path
- # The stylesheet
- self.stylesheet = stylesheet
- # Open the file in a writing stream
- self.xml_file = src.xmlManager.XmlLogFile(xml_file_path, "JobsReport")
+
+ def __init__(self, xml_dir_path, l_jobs, l_jobs_not_today, file_boards=""):
+ '''Initialization
+
+ :param xml_dir_path str: The path to the directory where to put
+ the xml resulting files
+ :param l_jobs List: the list of jobs that run today
+ :param l_jobs_not_today List: the list of jobs that do not run today
+ :param file_boards str: the file path from which to read the
+ expected boards
+ '''
+ # The path of the csv files to read to fill the expected boards
+ self.file_boards = file_boards
+
+ today = datetime.date.weekday(datetime.date.today())
+ self.parse_csv_boards(today)
+
+ # The path of the global xml file
+ self.xml_dir_path = xml_dir_path
+ # Initialize the xml files
+ xml_global_path = os.path.join(self.xml_dir_path, "global_report.xml")
+ self.xml_global_file = src.xmlManager.XmlLogFile(xml_global_path,
+ "JobsReport")
+ # The xml files that corresponds to the boards.
+ # {name_board : xml_object}}
+ self.d_xml_board_files = {}