[llvm-commits] [LNT] r166146 - in /lnt/trunk/lnt: lnttool/main.py server/reporting/dailyreport.py server/ui/templates/reporting/daily_report.html
Daniel Dunbar
daniel at zuster.org
Wed Oct 17 16:18:40 PDT 2012
Author: ddunbar
Date: Wed Oct 17 18:18:40 2012
New Revision: 166146
URL: http://llvm.org/viewvc/llvm-project?rev=166146&view=rev
Log:
dailyreport: Add additional headers when mailing report.
- This makes the report uglier, but easier to inline comments in replies to.
Modified:
lnt/trunk/lnt/lnttool/main.py
lnt/trunk/lnt/server/reporting/dailyreport.py
lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
Modified: lnt/trunk/lnt/lnttool/main.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/main.py?rev=166146&r1=166145&r2=166146&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/main.py (original)
+++ lnt/trunk/lnt/lnttool/main.py Wed Oct 17 18:18:40 2012
@@ -309,7 +309,7 @@
note("building report data...")
report = lnt.server.reporting.dailyreport.DailyReport(
ts, year=date.year, month=date.month, day=date.day,
- day_start_offset_hours=date.hour)
+ day_start_offset_hours=date.hour, for_mail=True)
report.build()
note("generating HTML report...")
Modified: lnt/trunk/lnt/server/reporting/dailyreport.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/dailyreport.py?rev=166146&r1=166145&r2=166146&view=diff
==============================================================================
--- lnt/trunk/lnt/server/reporting/dailyreport.py (original)
+++ lnt/trunk/lnt/server/reporting/dailyreport.py Wed Oct 17 18:18:40 2012
@@ -9,7 +9,7 @@
class DailyReport(object):
def __init__(self, ts, year, month, day, num_prior_days_to_include = 3,
- day_start_offset_hours=16):
+ day_start_offset_hours=16, for_mail=False):
self.ts = ts
self.num_prior_days_to_include = num_prior_days_to_include
self.year = year
@@ -18,6 +18,7 @@
self.fields = list(ts.Sample.get_primary_fields())
self.day_start_offset = datetime.timedelta(hours=day_start_offset_hours)
self.num_comparison_runs = 10
+ self.for_mail = True
# Computed values.
self.next_day = None
Modified: lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html?rev=166146&r1=166145&r2=166146&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html Wed Oct 17 18:18:40 2012
@@ -61,16 +61,26 @@
{# Generate the table showing the raw sample data. #}
{% for field,field_results in report.result_table|reverse %}
<h3>Result Table ({{ field.name }})</h3>
-<table border="1" style="{{ styles.table }}">
+
+{# If the report is for mail, we put the table header on each test. This is
+ ugly, however it makes it much easier to inline comments in replies to the
+ email. Given that is the primary purpose of the email, we trade off wasted
+ space for convenience. #}
+{% macro result_header() %}
+<table border="1" style="{{ styles.table }}; width: 800px;">
<thead>
<tr>
- <th style="{{ styles.th }}">Test Name</th>
- <th style="{{ styles.th }}">Machine Name</th>
+ <th style="{{ styles.th }}; width: 100px;">Test Name</th>
+ <th style="{{ styles.th }}; width: 350px;">Machine Name</th>
{% for i in range(report.num_prior_days_to_include)|reverse %}
<th style="{{ styles.th }}">Day - {{i}}</th>
{% endfor %}
</thead>
+{% endmacro %}
+
+{{ result_header() if not report.for_mail }}
{% for test,visible_results in field_results %}
+{{ result_header() if report.for_mail }}
<tr>
<td style="{{ styles.td }}" colspan="2"> <b>{{test.name}}</b></td>
<td style="{{ styles.td }}" colspan="{{report.num_prior_days_to_include}}"> </td>
@@ -89,9 +99,10 @@
{% endfor %}
</tr>
{% endfor %}
+{{ "</table><p>" if report.for_mail }}
{% endfor %}
-</table>
{% endfor %}
+{{ "</table>" if not report.for_mail }}
{% if not only_html_body %}
</body>
More information about the llvm-commits
mailing list