changeset 180:15ebb9de5049

merge
author Matt Johnston <matt@ucc.asn.au>
date Thu, 30 Jan 2014 22:56:17 +0800
parents 77c2a9caca3d (current diff) 30390852cb5d (diff)
children 1731a27bcdd2 e731c0d30b09 f4aabbf0da67
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)