From fd63321554f3c36bac34bc391ddc3cfa032cc250 Mon Sep 17 00:00:00 2001 From: Chrys Date: Sat, 11 Apr 2020 01:19:52 +0200 Subject: [PATCH] fix device detection --- .../inputDriver/evdevDriver.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index a64e3cf7..792b07d1 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -71,18 +71,21 @@ class driver(inputDriver): while device: self.env['runtime']['debug'].writeDebugOut('plugInputDeviceWatchdogUdev:' + str(device), debug.debugLevel.INFO) try: - if currDevice.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']: - ignorePlug = True - if currDevice.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']: - ignorePlug = True - if 'BRLTTY' in currDevice.name.upper(): - ignorePlug = True + try: + if device.name.upper() in ['','SPEAKUP','FENRIR-UINPUT']: + ignorePlug = True + if device.phys.upper() in ['','SPEAKUP','FENRIR-UINPUT']: + ignorePlug = True + if 'BRLTTY' in device.name.upper(): + ignorePlug = True + except Exception as e: + self.env['runtime']['debug'].writeDebugOut("plugInputDeviceWatchdogUdev CHECK NAME CRASH: " + str(e),debug.debugLevel.ERROR) if not ignorePlug: virtual = '/sys/devices/virtual/input/' in device.sys_path if device.device_node: validDevices.append({'device': device.device_node, 'virtual': virtual}) - except: - pass + except Exception as e: + self.env['runtime']['debug'].writeDebugOut("plugInputDeviceWatchdogUdev APPEND CRASH: " + str(e),debug.debugLevel.ERROR) try: pollTimeout = 1 device = monitor.poll(pollTimeout)