OSDN Git Service

brailliantB driver: Don't even provide this display as an option (i.e. make check...
authorJames Teh <jamie@jantrid.net>
Tue, 24 Jan 2012 08:20:49 +0000 (18:20 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 24 Jan 2012 08:20:49 +0000 (18:20 +1000)
This scan is very fast and unintrusive, so there's no reason not to do it.

source/brailleDisplayDrivers/brailliantB.py

index ad78be3..f2213f2 100644 (file)
@@ -80,6 +80,11 @@ class BrailleDisplayDriver(braille.BrailleDisplayDriver):
 \r
        @classmethod\r
        def check(cls):\r
+               try:\r
+                       next(_getPorts())\r
+               except StopIteration:\r
+                       # No possible ports found.\r
+                       return False\r
                return True\r
 \r
        def __init__(self):\r