[Treepkg-commits] r442 - trunk/contrib/sawmill/web/templates

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Sep 18 10:01:19 CEST 2010


Author: teichmann
Date: 2010-09-18 10:01:18 +0200 (Sat, 18 Sep 2010)
New Revision: 442

Modified:
   trunk/contrib/sawmill/web/templates/details.html
Log:
sawmill: Rearranged the postion of some python code in the details template to
make it more readable.


Modified: trunk/contrib/sawmill/web/templates/details.html
===================================================================
--- trunk/contrib/sawmill/web/templates/details.html	2010-09-18 07:50:53 UTC (rev 441)
+++ trunk/contrib/sawmill/web/templates/details.html	2010-09-18 08:01:18 UTC (rev 442)
@@ -5,6 +5,66 @@
 from xml.sax.saxutils import quoteattr
 
 from datetime import date, datetime
+
+def nn(s, d=""):
+    if not s: return d
+    return escape(s)
+
+def pretty_time(t, format="%H:%M:%S"):
+    if not t: return "<unknown>"
+    return t.strftime(format)
+
+def pretty_timedelta(a, b):
+    if a is None or b is None: return "<unknown>"
+    td = a - b
+    secs = td.days * 24*3600 + td.seconds
+    out = []
+    if secs > 3600:
+        hs = secs // 3600
+        out.append("%dh" % hs)
+        secs %= 3600
+    if secs > 60:
+        ms = secs // 60
+        out.append("%dm" % ms)
+        secs %= 60
+    if secs > 0 or not out:
+        out.append("%ds" % secs)
+    return " ".join(out)
+
+def date_from_datetime(x):
+    if not x: return None
+    return date(x.year, x.month, x.day)
+
+def sort_by_start(a, b):
+    a_start = a.build_start
+    b_start = b.build_start
+    if not a_start and not b_start: return 0
+    if not a_start: return 1
+    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
+
+STATUS2CLASS = {
+    'creating_binary_package': 'inprogress',
+    'creating_source_package': 'inprogress',
+    'source_package_created':  'inprogress',
+    'binary_package_created':  'finished'
+}
+
+STATUS2MSG = {
+    'creating_binary_package': 'building binary packages',
+    'creating_source_package': 'building source package',
+    'source_package_created':  'preparing build envrionment',
+    'binary_package_created':  'success'
+}
 %>
 <html>
   <head>
@@ -83,67 +143,6 @@
     <th class="statustablehead">Notes</th>
 </tr>
 <%
-
-def nn(s, d=""):
-    if not s: return d
-    return escape(s)
-
-def pretty_time(t, format="%H:%M:%S"):
-    if not t: return "&lt;unknown&gt;"
-    return t.strftime(format)
-
-def pretty_timedelta(a, b):
-    if a is None or b is None: return "&lt;unknown&gt;"
-    td = a - b
-    secs = td.days * 24*3600 + td.seconds
-    out = []
-    if secs > 3600:
-        hs = secs // 3600
-        out.append("%dh" % hs)
-        secs %= 3600
-    if secs > 60:
-        ms = secs // 60
-        out.append("%dm" % ms)
-        secs %= 60
-    if secs > 0 or not out:
-        out.append("%ds" % secs)
-    return " ".join(out)
-
-def date_from_datetime(x):
-    if not x: return None
-    return date(x.year, x.month, x.day)
-
-def sort_by_start(a, b):
-    a_start = a.build_start
-    b_start = b.build_start
-    if not a_start and not b_start: return 0
-    if not a_start: return 1
-    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
-
-STATUS2CLASS = {
-    'creating_binary_package': 'inprogress',
-    'creating_source_package': 'inprogress',
-    'source_package_created':  'inprogress',
-    'binary_package_created':  'finished'
-}
-
-STATUS2MSG = {
-    'creating_binary_package': 'building binary packages',
-    'creating_source_package': 'building source package',
-    'source_package_created':  'preparing build envrionment',
-    'binary_package_created':  'success'
-}
-
 for track_item in track_items:
     # for all track items
     curr_date = date_from_datetime(track_item.build_start)



More information about the Treepkg-commits mailing list