]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
Add a link to the last job result in the the jobs board if the job is not today
authorSerge Rehbinder <serge.rehbinder@cea.fr>
Fri, 21 Oct 2016 08:49:57 +0000 (10:49 +0200)
committerSerge Rehbinder <serge.rehbinder@cea.fr>
Fri, 21 Oct 2016 08:49:57 +0000 (10:49 +0200)
commands/jobs.py
src/xsl/jobs_board_report.xsl

index 371c5e6b3a98df98b6cea04dc64bdd92ccae172d..a62f68ead57c744468b4bb4b7a950648ede6950d 100644 (file)
@@ -1281,7 +1281,7 @@ class Gui(object):
                         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
   
     def put_jobs_not_today(self, l_jobs_not_today, xml_node_jobs):
@@ -1310,12 +1310,22 @@ class Gui(object):
             src.xmlManager.add_simple_node(xmlj, "sat_path",
                                                         job.machine.sat_path)
             xml_history = src.xmlManager.add_simple_node(xmlj, "history")
-            for date, res_job, link in self.history[job.name]:
-                src.xmlManager.add_simple_node(xml_history,
-                                               "link",
-                                               text=link,
-                                               attrib={"date" : date,
-                                                       "res" : res_job})
+            for i, (date, res_job, link) in enumerate(self.history[job.name]):
+                if i==0:
+                    # tag the first one (the last one)
+                    src.xmlManager.add_simple_node(xml_history,
+                                                   "link",
+                                                   text=link,
+                                                   attrib={"date" : date,
+                                                           "res" : res_job,
+                                                           "last" : "yes"})
+                else:
+                    src.xmlManager.add_simple_node(xml_history,
+                                                   "link",
+                                                   text=link,
+                                                   attrib={"date" : date,
+                                                           "res" : res_job,
+                                                           "last" : "no"})
 
     def parse_csv_boards(self, today):
         """ Parse the csv file that describes the boards to produce and fill 
index 326eddd5a8e5e53aa9ff5b27151607c22a4d175a..8f13c182375bb44f57b911f28900ba485a39e063 100644 (file)
              <xsl:for-each select="//JobsReport/jobs/job">
              
                  <xsl:sort select="@name" />
-                 
+                 <xsl:variable name="curr_job_name" select="@name" />
                  <xsl:if test="application/.=$curr_appli and distribution/.=$curr_distname and board/.=//JobsReport/board/.">
                      <!-- Change background color if it is an extra job (not defined in the input csv files) -->
                      <xsl:if test="extra_job/.='yes'">
                                    <xsl:attribute name="onclick">javascript:Toggle('<xsl:value-of select="@name"/>')</xsl:attribute>
                                    <xsl:attribute name="title"><xsl:value-of select="state/."/></xsl:attribute>
                                    <xsl:attribute name="class">NA2</xsl:attribute>
-                                   <xsl:value-of select="@name"/>
+                                   job
                              </a>
                            </xsl:when>
                      </xsl:choose>
                                 / <xsl:value-of select="port/."/>
                                </xsl:if>
                            </a>
+                     </xsl:if>
+                     <xsl:if test="state/.='Not today'">
+                        - 
+                       <xsl:for-each select="//JobsReport/jobs/job[@name=$curr_job_name]/history/link">
+                       <xsl:sort select="@date" order="descending" />
+                       <xsl:if test="@last='yes'">
+                         <h4>
+                           <a>
+                             <xsl:attribute name="title">remote log</xsl:attribute>
+                             <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
+                             <xsl:if test="@res='0'">
+                                 <xsl:attribute name="class">OK2</xsl:attribute>
+                             </xsl:if>
+                             <xsl:if test="@res!='0'">
+                                 <xsl:attribute name="class">KO2</xsl:attribute>
+                             </xsl:if>
+                             <xsl:value-of select="@date"/>
+                           </a>
+                         </h4>
+                       </xsl:if> 
+                       </xsl:for-each>
                      </xsl:if> 
                      <br/>