Changeset 4eab4cc in osmosefrontend
 Timestamp:
 Jan 19, 2013 3:31:33 PM (7 years ago)
 Branches:
 master
 Children:
 383bee9
 Parents:
 9b9f58c (diff), 3f851a2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.  Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

control.py
r9b9f58c rbed69c5 86 86 for analyser in matrix: 87 87 min = max = None 88 sum = 0 88 89 for country in matrix[analyser]: 89 90 v = matrix[analyser][country][1] 90 91 min = v if not min or v < min else min 91 92 max = v if not max or v > max else max 93 sum += v 92 94 if not stats_country.has_key(country): 93 95 min_c = v 96 sum_c = v 94 97 max_c = v 98 n_c = 1 95 99 else: 96 (min_c, max_c) = stats_country[country]100 (min_c, sum_c, max_c, n_c) = stats_country[country] 97 101 min_c = v if v < min_c else min_c 98 102 max_c = v if v > max_c else max_c 99 stats_country[country] = [min_c, max_c] 100 stats_analyser[analyser] = [min, max] 103 sum_c += v 104 n_c += 1 105 stats_country[country] = [min_c, sum_c, max_c, n_c] 106 stats_analyser[analyser] = [min, sum/len(matrix[analyser]), max] 107 avg_country = {} 108 for country in stats_country: 109 stats_country[country][1] = stats_country[country][1]/stats_country[country][3] 101 110 keys = sorted(keys.keys()) 102 111 
views/control/updates_matrix.tpl
r0d1ad4f r3f851a2 1 1 %rebase layout title=_("Last updates") 2 2 %def col(t, v): 3 % if v > 4 :3 % if v > 4.05: 4 4 <{{t}} class="delayerror">\\ 5 % elif v > 2 :5 % elif v > 2.05: 6 6 <{{t}} class="delaywarning">\\ 7 7 % else: … … 13 13 <table> 14 14 <tr> 15 <th colspan="3" rowspan="3"/> 15 <th colspan="4" rowspan="4"/> 16 %keys = sorted(keys, key=lambda k: stats_country[k][1]) 16 17 %for k in keys: 17 18 <th class="country"><div class="rotate90"><a href="../errors/?country={{k}}">{{k}}</a></div></th> 18 19 %end 19 20 </tr> 21 %for i in range(0,3): 20 22 <tr> 21 %for k in keys: 22 % col('th', stats_country[k][0]) 23 {{"%0.1f"%stats_country[k][0]}}</th> 23 % for k in keys: 24 % col('th', stats_country[k][i]) 25 {{"%0.1f"%stats_country[k][i]}}</th> 26 % end 27 </tr> 24 28 %end 25 </tr> 26 <tr> 27 %for k in keys: 28 % col('th', stats_country[k][1]) 29 {{"%0.1f"%stats_country[k][1]}}</th> 30 %end 31 </tr> 32 %for r in sorted(matrix.keys()): 29 %for r in sorted(matrix.keys(), key=lambda k: stats_analyser[k][1]): 33 30 <tr> 34 31 <th style="textalign: left">{{r}}</th> 35 % col('th', stats_analyser[r][0])36 {{"%0.1f"%stats_analyser[r][0]}}</th> 37 % col('th', stats_analyser[r][1]) 38 {{"%0.1f"%stats_analyser[r][1]}}</th> 32 % for i in range(0,3): 33 % col('th', stats_analyser[r][i]) 34 {{"%0.1f"%stats_analyser[r][i]}}</th> 35 % end 39 36 % for k in keys: 40 37 % if matrix[r].has_key(k):
Note: See TracChangeset
for help on using the changeset viewer.