remove debug

This commit is contained in:
chrys 2018-05-28 22:35:24 +02:00
parent b4ce1ecf80
commit ac48ecc89b

View File

@ -165,29 +165,24 @@ class driver(inputDriver):
eventType = evdev.events eventType = evdev.events
for deviceFile in deviceFileList: for deviceFile in deviceFileList:
try: try:
self.env['runtime']['debug'].writeDebugOut('loop start',debug.debugLevel.ERROR)
if not deviceFile: if not deviceFile:
continue continue
if deviceFile == '': if deviceFile == '':
continue continue
if deviceFile in iDevicesFiles: if deviceFile in iDevicesFiles:
continue continue
self.env['runtime']['debug'].writeDebugOut('open(deviceFile)',debug.debugLevel.ERROR)
try: try:
with open(deviceFile) as f: with open(deviceFile) as f:
pass pass
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut("Not readable Inputdevice : " + deviceFile +' ' + str(e),debug.debugLevel.ERROR)
continue continue
# 3 pos absolute # 3 pos absolute
# 2 pos relative # 2 pos relative
# 1 Keys # 1 Keys
self.env['runtime']['debug'].writeDebugOut('currDevice = evdev.InputDevice(deviceFile)',debug.debugLevel.ERROR)
try: try:
currDevice = evdev.InputDevice(deviceFile) currDevice = evdev.InputDevice(deviceFile)
except: except:
continue continue
self.env['runtime']['debug'].writeDebugOut('naming',debug.debugLevel.ERROR)
try: try:
if currDevice.name.upper() in ['','SPEAKUP','PY-EVDEV-UINPUT']: if currDevice.name.upper() in ['','SPEAKUP','PY-EVDEV-UINPUT']:
continue continue
@ -195,15 +190,11 @@ class driver(inputDriver):
continue continue
if 'BRLTTY' in currDevice.name.upper(): if 'BRLTTY' in currDevice.name.upper():
continue continue
self.env['runtime']['debug'].writeDebugOut('loaded name:'+ str(currDevice.name),debug.debugLevel.ERROR)
except: except:
pass pass
self.env['runtime']['debug'].writeDebugOut('cap = currDevice.capabilities()',debug.debugLevel.ERROR)
cap = currDevice.capabilities() cap = currDevice.capabilities()
self.env['runtime']['debug'].writeDebugOut('cap = currDevice.capabilities() fin',debug.debugLevel.ERROR)
if mode in ['ALL','NOMICE']: if mode in ['ALL','NOMICE']:
if eventType.EV_KEY in cap: if eventType.EV_KEY in cap:
self.env['runtime']['debug'].writeDebugOut('eventType.EV_KEY in cap NoOfCaps: '+ str(cap) ,debug.debugLevel.ERROR)
if 116 in cap[eventType.EV_KEY] and len(cap[eventType.EV_KEY]) < 10: 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) self.env['runtime']['debug'].writeDebugOut('Device Skipped (has 116):' + currDevice.name,debug.debugLevel.INFO)
continue continue
@ -224,7 +215,6 @@ class driver(inputDriver):
elif currDevice.name.upper() in mode.split(','): elif currDevice.name.upper() in mode.split(','):
self.addDevice(currDevice) self.addDevice(currDevice)
self.env['runtime']['debug'].writeDebugOut('Device added (Name):' + self.iDevices[currDevice.fd].name,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut('Device added (Name):' + self.iDevices[currDevice.fd].name,debug.debugLevel.INFO)
self.env['runtime']['debug'].writeDebugOut('loop end',debug.debugLevel.ERROR)
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut("Device Skipped (Exception): " + deviceFile +' ' + currDevice.name +' '+ str(e),debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("Device Skipped (Exception): " + deviceFile +' ' + currDevice.name +' '+ str(e),debug.debugLevel.INFO)
self.iDeviceNo = len(evdev.list_devices()) self.iDeviceNo = len(evdev.list_devices())