From d2c53e2d58e2eb544352c547d8b9db7b5f25c418 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 21 May 2018 20:15:43 +0200 Subject: [PATCH] debug --- src/fenrirscreenreader/inputDriver/evdevDriver.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index 4bf16605..c14a167b 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -167,14 +167,18 @@ class driver(inputDriver): eventType = evdev.events for deviceFile in deviceFileList: try: + self.env['runtime']['debug'].writeDebugOut('Debug: not deviceFile',debug.debugLevel.ERROR) if not deviceFile: continue + self.env['runtime']['debug'].writeDebugOut('Debug: deviceFile == '' ',debug.debugLevel.ERROR) if deviceFile == '': continue + self.env['runtime']['debug'].writeDebugOut('Debug: deviceFile in iDevicesFiles ',debug.debugLevel.ERROR) if deviceFile in iDevicesFiles: continue try: + self.env['runtime']['debug '].writeDebugOut('Debug: open(deviceFile)',debug.debugLevel.ERROR) open(deviceFile) except Exception as e: self.env['runtime']['debug'].writeDebugOut("Not readable Inputdevice : " + deviceFile +' ' + str(e),debug.debugLevel.ERROR) @@ -184,6 +188,7 @@ class driver(inputDriver): # 1 Keys try: + self.env['runtime']['debug '].writeDebugOut('Debug: currDevice = evdev.InputDevice(deviceFile)',debug.debugLevel.ERROR) currDevice = evdev.InputDevice(deviceFile) except: continue @@ -194,20 +199,23 @@ class driver(inputDriver): if currDevice.phys.upper() in ['','SPEAKUP','PY-EVDEV-UINPUT']: continue if 'BRLTTY' in currDevice.name.upper(): - continue + continue + self.env['runtime']['debug '].writeDebugOut('Debug: namecheck',debug.debugLevel.ERROR) except: pass cap = currDevice.capabilities() + self.env['runtime']['debug '].writeDebugOut('Debug: cap = currDevice.capabilities()',debug.debugLevel.ERROR) if mode in ['ALL','NOMICE']: if eventType.EV_KEY in cap: + self.env['runtime']['debug '].writeDebugOut('Debug: eventType.EV_KEY in cap',debug.debugLevel.ERROR) if 116 in cap[eventType.EV_KEY] and len(cap[eventType.EV_KEY]) < 10: self.env['runtime']['debug'].writeDebugOut('Device Skipped (has 116):' + currDevice.name,debug.debugLevel.INFO) continue if len(cap[eventType.EV_KEY]) < 60: self.env['runtime']['debug'].writeDebugOut('Device Skipped (< 60 keys):' + currDevice.name,debug.debugLevel.INFO) continue - if mode == 'ALL': + if mode == 'ALL': self.addDevice(currDevice) self.env['runtime']['debug'].writeDebugOut('Device added (ALL):' + self.iDevices[currDevice.fd].name, debug.debugLevel.INFO) elif mode == 'NOMICE':