def run(self): self.serial.open() while True: try: socks = [self.multisocket, self.serial] ready = select.select(socks, [], []) handlers = self.ready_handlers() for h, r in zip(handlers, ready): if h in r: try: h[r]() except KeyError, e: pass except Exception, e: print 'Exception handling: %s' % repr(e) net.printtraceback()
def run(self): self.serial.open() while True: try: socks = [self.multisocket, self.serial] ready = select.select(socks, [], []) handlers = self.ready_handlers() for h, r in zip(handlers, ready): if h in r: try: h[r]() except KeyError, e: pass except Exception, e: print 'Exception handling: %s' % repr(e) net.printtraceback() else: pass except Exception, e: print 'Exception: %s' % repr(e) net.printtraceback() if __name__ == '__main__': sc = SerialController(50002, '/dev/ttyUSB1') sc.run()
self.serial.open() while True: try: socks = [self.multisocket, self.serial] ready = select.select(socks, [], []) handlers = self.ready_handlers() for h, r in zip(handlers, ready): if h in r: try: h[r]() except KeyError, e: pass except Exception, e: print 'Exception handling: %s' % repr(e) net.printtraceback() else: pass except Exception, e: print 'Exception: %s' % repr(e) net.printtraceback() if __name__ == '__main__': sc = SerialController(50002, '/dev/ttyUSB1') sc.run()