changeset 474:a8f77807d710

sawmill: create links for tag builds
author Sascha Teichmann <teichmann@intevation.de>
date Fri, 10 Sep 2010 14:18:07 +0000
parents d8012571f9e1
children 7be221f41f58
files contrib/sawmill/web/details.py contrib/sawmill/web/templates/details.html
diffstat 2 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/sawmill/web/details.py	Fri Sep 10 10:46:50 2010 +0000
+++ b/contrib/sawmill/web/details.py	Fri Sep 10 14:18:07 2010 +0000
@@ -43,6 +43,7 @@
         self.start       = None
         self.stop        = None
         self.logs        = None
+        self.tags        = None
 
     def check_loaded(self):
         if not self.loaded:
@@ -56,6 +57,7 @@
                     if   key == 'status': self.status = value
                     elif key == 'start':  self.start  = _create_time(value)
                     elif key == 'stop':   self.stop   = _create_time(value)
+                    elif key == 'tags':   self.tags   = value
             finally:
                 f.close()
             self.loaded = True
@@ -72,6 +74,10 @@
         self.check_loaded()
         return self.stop
 
+    def get_tags(self):
+        self.check_loaded()
+        return self.tags
+
     def log_path(self, log):
         return "%s/tracks/%s/pkg/%s/log/%s" % (
             self.treepkg, self.track, self.revision, log)
@@ -92,13 +98,14 @@
     build_start  = property(get_build_start)
     build_stop   = property(get_build_stop)
     build_logs   = property(get_build_logs)
+    build_tags   = property(get_tags)
 
 
 def __scan_track_items(treepkg, path):
     items = []
 
     tracks_path = os.path.join(path, "tracks")
-    if os.path.isdir(track_path):
+    if os.path.isdir(tracks_path):
         for track in os.listdir(tracks_path):
             track_path = os.path.join(tracks_path, track)
             if not os.path.isdir(track_path): continue
--- a/contrib/sawmill/web/templates/details.html	Fri Sep 10 10:46:50 2010 +0000
+++ b/contrib/sawmill/web/templates/details.html	Fri Sep 10 14:18:07 2010 +0000
@@ -103,6 +103,11 @@
     if not b_start: return -1
     return cmp(a_start, b_start)
 
+def create_tags_link(tag_url):
+    return quoteattr(tag_url.replace(
+        "svn://anonsvn.kde.org/home/kde",
+        "http://websvn.kde.org"))
+
 track_items = sorted(track_items, cmp=sort_by_start, reverse=True)
 
 last_date = None
@@ -134,7 +139,22 @@
 <tr class="<%= STATUS2CLASS.get(track_item.build_status, 'error') %>">
     <td><%= STATUS2MSG.get(track_item.build_status, 'error') %></td>
     <td style="font-weight:bold;"><%= nn(track_item.track) %></td>
-    <td align="right"><%= nn(track_item.revision) %></td>
+    <td align="right">
+<%
+    tags = track_item.build_tags
+    if tags:
+        # a tag
+%>
+    <a href=<%= create_tags_link(tags) %>><strong><%= nn(track_item.revision) %></strong></a>
+<%
+    else:
+        # not a tag
+%>
+    <%= nn(track_item.revision) %>
+<%
+    # end if tags
+%>
+    </td>
     <td><%= pretty_time(track_item.build_start) %></td>
     <td><%= pretty_time(track_item.build_stop) %></td>
     <td>
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)