[Treepkg-commits] r434 - in trunk/contrib/sawmill/web: . templates

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 10 16:18:08 CEST 2010


Author: teichmann
Date: 2010-09-10 16:18:07 +0200 (Fri, 10 Sep 2010)
New Revision: 434

Modified:
   trunk/contrib/sawmill/web/details.py
   trunk/contrib/sawmill/web/templates/details.html
Log:
sawmill: create links for tag builds

Modified: trunk/contrib/sawmill/web/details.py
===================================================================
--- trunk/contrib/sawmill/web/details.py	2010-09-10 10:46:50 UTC (rev 433)
+++ trunk/contrib/sawmill/web/details.py	2010-09-10 14:18:07 UTC (rev 434)
@@ -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

Modified: trunk/contrib/sawmill/web/templates/details.html
===================================================================
--- trunk/contrib/sawmill/web/templates/details.html	2010-09-10 10:46:50 UTC (rev 433)
+++ trunk/contrib/sawmill/web/templates/details.html	2010-09-10 14:18:07 UTC (rev 434)
@@ -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>



More information about the Treepkg-commits mailing list