From: James Teh Date: Tue, 24 Jan 2012 08:20:49 +0000 (+1000) Subject: brailliantB driver: Don't even provide this display as an option (i.e. make check... X-Git-Tag: jpdev130418~1123 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=be9edb6b435ffeb0c3cf973eeca3f13ce8bb77d9;p=nvdajp%2Fnvdajp.git brailliantB driver: Don't even provide this display as an option (i.e. make check() return False) if no possible ports are found; i.e. no USB driver is installed and a display hasn't been paired via bluetooth. This scan is very fast and unintrusive, so there's no reason not to do it. --- diff --git a/source/brailleDisplayDrivers/brailliantB.py b/source/brailleDisplayDrivers/brailliantB.py index ad78be350..f2213f23c 100644 --- a/source/brailleDisplayDrivers/brailliantB.py +++ b/source/brailleDisplayDrivers/brailliantB.py @@ -80,6 +80,11 @@ class BrailleDisplayDriver(braille.BrailleDisplayDriver): @classmethod def check(cls): + try: + next(_getPorts()) + except StopIteration: + # No possible ports found. + return False return True def __init__(self):