changeset 479:3ac15a9be1b6

merge
author Matt Johnston <matt@ucc.asn.au>
date Thu, 30 Jan 2014 22:56:17 +0800
parents d05b1612e19e (current diff) fc8ddea46987 (diff)
children 6d464ac4ba3c 9950ffa9a79b 1865674794c3
files
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/web/log.py	Thu Jan 30 22:55:27 2014 +0800
+++ b/web/log.py	Thu Jan 30 22:56:17 2014 +0800
@@ -78,6 +78,9 @@
 
     volts_mult = 1.0/volts_div
 
+    # (title, sensorline) pairs.
+    sensor_lines = []
+
     for n, (rrdfile, sensor) in enumerate(rrds):
         unit = None
         if 'avrtemp' in sensor:
@@ -112,7 +115,11 @@
             print_legend = '%s (%s)' % (legend, format_last_value)
         else:
             print_legend = legend
-        graph_args.append('LINE%(width)f:%(vname)s#%(colour)s:%(print_legend)s' % locals())
+        sensor_lines.append( (legend, 'LINE%(width)f:%(vname)s#%(colour)s:%(print_legend)s' % locals()) )
+
+    sensor_lines.sort(key = lambda (legend, line): "Wort" in legend)
+
+    graph_args += (line for (legend, line) in sensor_lines)
 
     end = int(start+length)
     start = int(start)