eastein/chatlight — Issue #12: device disappearing during autoselect crashes watch_reports
Author: eastein
Created: 2012-01-07 03:04:32+00:00
State: open

blink_on = 0
auto selected device /dev/ttyUSB0
Traceback (most recent call last):
File "./watch_reports", line 102, in
ctl.set_main(dict())
File "/home/toba/git/chatlight/serial_controller.py", line 79, in set_main
self.set_parameters(getattr(self, n), 0, 1, 0, 1)
File "/home/toba/git/chatlight/serial_controller.py", line 110, in set_parameters
self.serial = self.serial_opener()
File "./watch_reports", line 52, in
serial_opener = lambda: serial.Serial(device(), 115200, timeout=1)
File "./watch_reports", line 34, in
return lambda: auto_device()
File "./watch_reports", line 16, in auto_device
devs = look()
File "./watch_reports", line 15, in
look = lambda: [(dev, os.stat(dev)) for dev in [os.path.join(devdir, dev) for dev in os.listdir(devdir) if 'ttyUSB' in dev]]
OSError: [Errno 2] No such file or directory: '/dev/ttyUSB0'