must not pass float to GObject.timeout_add
authorHelmut Grohne <helmut@subdivi.de>
Sun, 14 Jul 2013 06:59:33 +0000 (08:59 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Sun, 14 Jul 2013 06:59:33 +0000 (08:59 +0200)
onoff/common.py
onoff/process.py

index 3f63afd..cb27b66 100644 (file)
@@ -100,7 +100,7 @@ class ThrottledDevice(OnoffDevice):
 
     def _schedule_transition(self, delay, func):
         assert self.transition is None
-        self.transition = GObject.timeout_add(1000 * delay, func)
+        self.transition = GObject.timeout_add(int(1000 * delay), func)
 
     def _cancel_transition(self):
         assert self.transition is not None
index 68deb97..2b75bda 100644 (file)
@@ -57,7 +57,7 @@ class OnoffProcess(OnoffDevice):
         logger.info("starting command %s", " ".join(self.command))
         self.pid, self.watch = spawn_child(self.command, self.process_died)
         logger.debug("started as pid %d", self.pid)
-        self.starting = GObject.timeout_add(1000 * self.start_wait,
+        self.starting = GObject.timeout_add(int(1000 * self.start_wait),
                                             self.process_started)
         self.changestate(self.state)