diff py/tempserver.py @ 229:99255c501e02

test sensor
author Matt Johnston <matt@ucc.asn.au>
date Fri, 10 Apr 2015 23:55:07 +0800
parents d9e81a563923
children 185621f47040
line wrap: on
line diff
--- a/py/tempserver.py	Fri Mar 20 20:12:25 2015 +0800
+++ b/py/tempserver.py	Fri Apr 10 23:55:07 2015 +0800
@@ -31,7 +31,7 @@
         self.fridge = fridge.Fridge(self)
         self.uploader = uploader.Uploader(self)
         self.params.load()
-        self.set_sensors(sensor_ds18b20.DS18B20s(self))
+        self.set_sensors(sensor.make_sensor(self))
         asyncio.get_event_loop().add_signal_handler(signal.SIGHUP, self._reload_signal)
         return self
 
@@ -102,7 +102,7 @@
             L("Reloaded.")
             self._wakeup.set()
             self._wakeup.clear()
-        except self.Error, e:
+        except Error as e:
             W("Problem reloading: %s" % str(e))
 
 def setup_logging():
@@ -124,7 +124,7 @@
     try:
         pidf.acquire(1)
         pidf.release()
-    except (lockfile.AlreadyLocked, lockfile.LockTimeout), e:
+    except (lockfile.AlreadyLocked, lockfile.LockTimeout) as e:
         pid = pidf.read_pid()
         if do_hup:
             try: