# HG changeset patch # User Sascha Teichmann # Date 1284668694 0 # Node ID 7504ed4437e15bf83e56f9aeca2b8d92e7b45841 # Parent 43bb1cc38fba03b92d2f49eba75df6ea53e3df0f sawmill: short start and stop to %H:%M:%S because the date is already printed in the date row. Introduced a column with the duration to create the package. diff -r 43bb1cc38fba -r 7504ed4437e1 contrib/sawmill/web/templates/details.html --- a/contrib/sawmill/web/templates/details.html Tue Sep 14 11:02:37 2010 +0000 +++ b/contrib/sawmill/web/templates/details.html Thu Sep 16 20:24:54 2010 +0000 @@ -9,7 +9,7 @@ - + Sägewerk - <%= escape(description) %> @@ -79,6 +79,7 @@ Revision Start Stop + Duration Notes <% @@ -87,10 +88,26 @@ if not s: return d return escape(s) -def pretty_time(t, format="%Y-%m-%d %H:%M:%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 @@ -138,48 +155,48 @@ # date changed %> - <%= STATUS2MSG.get(track_item.build_status, 'error') %> - <%= nn(track_item.track) %> - +<%= STATUS2MSG.get(track_item.build_status, 'error') %> +<%= nn(track_item.track) %> + <% tags = track_item.build_tags if tags: # a tag %> - ><%= nn(track_item.revision) %> +><%= nn(track_item.revision) %> <% else: # not a tag %> - <%= nn(track_item.revision) %> +<%= nn(track_item.revision) %> <% # end if tags %> - - <%= pretty_time(track_item.build_start) %> - <%= pretty_time(track_item.build_stop) %> - + +<%= pretty_time(track_item.build_start) %> +<%= pretty_time(track_item.build_stop) %> +<%= pretty_timedelta(track_item.stop, track_item.build_start) %> + <% for log_desc, log_path in track_item.build_logs: # for all logs %> [><%= nn(log_desc) %>] - <% # for all logs %> - + - <% # for all track itemes %>
-report generated at <%= pretty_time(datetime.now()) %>, powered +report generated at <%= pretty_time(datetime.now(), "%Y-%m-%d %H:%M:%S") %>, powered by Tree Packager + diff -r 43bb1cc38fba -r 7504ed4437e1 contrib/sawmill/web/templates/overview.html --- a/contrib/sawmill/web/templates/overview.html Tue Sep 14 11:02:37 2010 +0000 +++ b/contrib/sawmill/web/templates/overview.html Thu Sep 16 20:24:54 2010 +0000 @@ -7,7 +7,7 @@ - + Sägewerk - Free Software forestry