def on_read_ready(self, f, mask): self.tk.after_cancel(self.timeout_id) self.timeout_id = False line = f.readline() todo = self.todo print line if (not line): self.todo = False todo(-2, -2) return rs = re.search("\\(([0-9]*) \\. ([0-9]*)\\)", line) if (rs): self.todo = False todo(int(rs.group(1)), int(rs.group(2))) tkinter.deletefilehandler(self.proc.stdout)
def stop(self): """Stop listening for remote control commands.""" if self._enabled: self._enabled = None tkinter.deletefilehandler(self._fileno)
def on_timeout(self) : tkinter.deletefilehandler(self.proc.stdout) todo = self.todo self.todo = False todo(-1, -1)
def stop_move(self): self.tk.after_cancel(self.timeout_id) tkinter.deletefilehandler(self.proc.stdout) self.todo = False self.timeout_id = False
def on_err_ready(self, err, mask): line = err.readline() if line: print line else: tkinter.deletefilehandler(err)