Mercurial > treepkg
view contrib/sawmill/web/templates/details.html @ 568:bf8114a76224
Add more debug output
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Fri, 02 Sep 2011 11:19:03 +0000 |
parents | e075ce66e085 |
children |
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <%@include file="header.inc" %> <% from cgi import escape from xml.sax.saxutils import quoteattr from datetime import date, datetime %> <div class="css_prison"> <h1><%= escape(description) %></h1> <%= header %> <table class="statustable"> <tr> <th class="statustablehead">Status</th> <th class="statustablehead">Package</th> <th class="statustablehead">Revision</th> <th class="statustablehead">Start</th> <th class="statustablehead">Stop</th> <th class="statustablehead">Duration</th> <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 "<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' } for track_item in track_items: # for all track items curr_date = date_from_datetime(track_item.build_start) if curr_date != last_date: last_date = curr_date %><tr class="date_row"><td colspan="7"><%= pretty_time(last_date, "%Y-%m-%d") %> (times in UTC)</td></tr><% # date changed %> <tr class="<%= STATUS2CLASS.get(track_item.build_status, 'error') %>"> <td><a name=<%= quoteattr(track_item.build_label) %>><%= STATUS2MSG.get(track_item.build_status, 'error') %></a></td> <td><b><%= nn(track_item.track) %></b></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 align="right"><%= pretty_time(track_item.build_start) %></td> <td align="right"><%= pretty_time(track_item.build_stop) %></td> <td align="right"><%= pretty_timedelta(track_item.stop, track_item.build_start) %></td> <td><% for log_desc, log_path in track_item.build_logs: # for all logs %>[<a href=<%= quoteattr("%s/%s" % (base_dir, log_path)) %>><%= nn(log_desc) %></a>] <% # for all logs %></td></tr><% # for all track itemes %> </table> <hr> report generated at <%= pretty_time(datetime.now(), "%Y-%m-%d %H:%M:%S") %>, powered by <a href="http://treepkg.wald.intevation.org">Tree Packager</a> </div> <%@include file="footer.inc" %> </html>