+ # Find the missing jobs not today
+ xml_missing_not_today = src.xmlManager.add_simple_node(
+ xml_root_board,
+ "missing_jobs_not_today")
+ for row, column in self.d_input_boards[board]["jobs_not_today"]:
+ found = False
+ for job in l_jobs_not_today:
+ if (job.application == column and
+ job.machine.distribution == row):
+ found = True
+ break
+ if not found:
+ src.xmlManager.add_simple_node(xml_missing_not_today,
+ "job",
+ attrib={"distribution" : row,
+ "application" : column })
+
+ def find_history(self, l_jobs, l_jobs_not_today):
+ """find, for each job, in the existent xml boards the results for the
+ job. Store the results in the dictionnary self.history = {name_job :
+ list of (date, status, list links)}
+
+ :param l_jobs List: the list of jobs to run today
+ :param l_jobs_not_today List: the list of jobs that do not run today
+ """
+ # load the all the history
+ expression = "^[0-9]{8}_+[0-9]{6}_" + self.global_name + ".xml$"
+ oExpr = re.compile(expression)
+ # Get the list of global xml that are in the log directory
+ l_globalxml = []
+ for file_name in os.listdir(self.xml_dir_path):
+ if oExpr.search(file_name):
+ file_path = os.path.join(self.xml_dir_path, file_name)
+ try:
+ global_xml = src.xmlManager.ReadXmlFile(file_path)
+ l_globalxml.append(global_xml)
+ except Exception as e:
+ msg = _("\nWARNING: the file %s can not be read, it will be "
+ "ignored\n%s" % (file_path, e))
+ self.logger.write("%s\n" % src.printcolors.printcWarning(
+ msg), 5)
+
+ # Construct the dictionnary self.history
+ for job in l_jobs + l_jobs_not_today:
+ l_links = []
+ for global_xml in l_globalxml:
+ date = os.path.basename(global_xml.filePath).split("_")[0]
+ global_root_node = global_xml.xmlroot.find("jobs")
+ job_node = src.xmlManager.find_node_by_attrib(
+ global_root_node,
+ "job",
+ "name",
+ job.name)
+ if job_node:
+ if job_node.find("remote_log_file_path") is not None:
+ link = job_node.find("remote_log_file_path").text
+ res_job = job_node.find("res").text
+ if link != "nothing":
+ l_links.append((date, res_job, link))
+ l_links = sorted(l_links, reverse=True)
+ self.history[job.name] = l_links
+