comparison web/log.py @ 32:e18d7e89c17d

More minor work
author Matt Johnston <matt@ucc.asn.au>
date Thu, 14 Jun 2012 00:00:57 +0800
parents 5e75e08d20ac
children 024f5571df8c
comparison
equal deleted inserted replaced
31:5e75e08d20ac 32:e18d7e89c17d
69 69
70 values = ['%f:%f' % p for p in 70 values = ['%f:%f' % p for p in
71 zip((first_real_time + time_step*t for t in xrange(len(measurements))), 71 zip((first_real_time + time_step*t for t in xrange(len(measurements))),
72 measurements)] 72 measurements)]
73 73
74 rrdtool.update(sensor_rrd_path(sensor_id), *values) 74 rrdfile = sensor_rrd_path(sensor_id)
75 rrdtool.update(rrdfile, *values)
76 f = file(rrdfile)
77 os.fsync(f.fileno())
75 78
76 def parse(lines): 79 def parse(lines):
77 entries = dict(l.split('=', 1) for l in lines) 80 entries = dict(l.split('=', 1) for l in lines)
78 if len(entries) != len(lines): 81 if len(entries) != len(lines):
79 raise Exception("Keys are not unique") 82 raise Exception("Keys are not unique")