comparison py/sensor_test.py @ 529:5201f441bf4a

run 2to3
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Apr 2015 23:59:16 +0800
parents 61e61de49a50
children a01b7bccccd3
comparison
equal deleted inserted replaced
528:61e61de49a50 529:5201f441bf4a
10 10
11 def make_vals(self): 11 def make_vals(self):
12 def try_read(f, fallback): 12 def try_read(f, fallback):
13 try: 13 try:
14 return open(f, 'r').read() 14 return open(f, 'r').read()
15 except Exception, e: 15 except Exception as e:
16 return fallback 16 return fallback
17 17
18 vals = {} 18 vals = {}
19 vals[self.wort_name()] = try_read('test_wort.txt', 18) 19 vals[self.wort_name()] = try_read('test_wort.txt', 18)
20 vals[self.fridge_name()] = try_read('test_fridge.txt', 20) 20 vals[self.fridge_name()] = try_read('test_fridge.txt', 20)