teichmann@473: teichmann@486: teichmann@486: <%@include file="header.inc" %> teichmann@488: <% teichmann@488: from cgi import escape teichmann@488: from xml.sax.saxutils import quoteattr teichmann@488: from datetime import date, datetime teichmann@488: %> teichmann@486:
teichmann@486:

<%= escape(description) %>

teichmann@486: <%= header %> teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@486: teichmann@452: <% teichmann@482: def nn(s, d=""): teichmann@482: if not s: return d teichmann@482: return escape(s) teichmann@482: teichmann@482: def pretty_time(t, format="%H:%M:%S"): teichmann@482: if not t: return "<unknown>" teichmann@482: return t.strftime(format) teichmann@482: teichmann@482: def pretty_timedelta(a, b): teichmann@482: if a is None or b is None: return "<unknown>" teichmann@482: td = a - b teichmann@482: secs = td.days * 24*3600 + td.seconds teichmann@482: out = [] teichmann@493: if secs >= 3600: teichmann@482: hs = secs // 3600 teichmann@482: out.append("%dh" % hs) teichmann@482: secs %= 3600 teichmann@493: if secs >= 60: teichmann@482: ms = secs // 60 teichmann@482: out.append("%dm" % ms) teichmann@482: secs %= 60 teichmann@482: if secs > 0 or not out: teichmann@482: out.append("%ds" % secs) teichmann@482: return " ".join(out) teichmann@482: teichmann@482: def date_from_datetime(x): teichmann@482: if not x: return None teichmann@482: return date(x.year, x.month, x.day) teichmann@482: teichmann@482: def sort_by_start(a, b): teichmann@482: a_start = a.build_start teichmann@482: b_start = b.build_start teichmann@482: if not a_start and not b_start: return 0 teichmann@482: if not a_start: return 1 teichmann@482: if not b_start: return -1 teichmann@482: return cmp(a_start, b_start) teichmann@482: teichmann@482: def create_tags_link(tag_url): teichmann@482: return quoteattr(tag_url.replace( teichmann@482: "svn://anonsvn.kde.org/home/kde", teichmann@482: "http://websvn.kde.org")) teichmann@482: teichmann@482: track_items = sorted(track_items, cmp=sort_by_start, reverse=True) teichmann@482: teichmann@482: last_date = None teichmann@482: teichmann@482: STATUS2CLASS = { teichmann@482: 'creating_binary_package': 'inprogress', teichmann@482: 'creating_source_package': 'inprogress', teichmann@482: 'source_package_created': 'inprogress', teichmann@482: 'binary_package_created': 'finished' teichmann@482: } teichmann@482: teichmann@482: STATUS2MSG = { teichmann@482: 'creating_binary_package': 'building binary packages', teichmann@482: 'creating_source_package': 'building source package', teichmann@482: 'source_package_created': 'preparing build envrionment', teichmann@482: 'binary_package_created': 'success' teichmann@482: } teichmann@452: teichmann@452: for track_item in track_items: teichmann@452: # for all track items teichmann@452: curr_date = date_from_datetime(track_item.build_start) teichmann@452: if curr_date != last_date: teichmann@452: last_date = curr_date teichmann@490: %><% teichmann@452: # date changed teichmann@452: %> teichmann@452: teichmann@490: teichmann@490: teichmann@484: teichmann@478: teichmann@478: teichmann@478: teichmann@490: <% teichmann@452: # for all track itemes teichmann@452: %> teichmann@452: teichmann@452:
StatusPackageRevisionStartStopDurationNotes
<%= pretty_time(last_date, "%Y-%m-%d") %> (times in UTC)
><%= STATUS2MSG.get(track_item.build_status, 'error') %><%= nn(track_item.track) %><% teichmann@474: tags = track_item.build_tags teichmann@474: if tags: teichmann@474: # a tag teichmann@490: %>><%= nn(track_item.revision) %><% teichmann@474: else: teichmann@474: # not a tag teichmann@484: %><%= nn(track_item.revision) %><% teichmann@474: # end if tags teichmann@484: %><%= pretty_time(track_item.build_start) %><%= pretty_time(track_item.build_stop) %><%= pretty_timedelta(track_item.stop, track_item.build_start) %><% teichmann@452: for log_desc, log_path in track_item.build_logs: teichmann@452: # for all logs teichmann@490: %>[><%= nn(log_desc) %>] teichmann@452: <% teichmann@452: # for all logs teichmann@490: %>
teichmann@475:
teichmann@478: report generated at <%= pretty_time(datetime.now(), "%Y-%m-%d %H:%M:%S") %>, powered teichmann@475: by Tree Packager teichmann@485:
teichmann@452: teichmann@483: <%@include file="footer.inc" %> teichmann@452: