From 77db18f366f26a6e416c1eb4cf56e52571379149 Mon Sep 17 00:00:00 2001 From: chrys Date: Wed, 19 Oct 2016 16:15:37 +0200 Subject: [PATCH] update debug code in traceEvdev --- tools/traceEvdev.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/traceEvdev.py b/tools/traceEvdev.py index b0001182..012a38b2 100755 --- a/tools/traceEvdev.py +++ b/tools/traceEvdev.py @@ -5,9 +5,16 @@ from select import select import time devices = map(evdev.InputDevice, (evdev.list_devices())) -devices = {dev.fd: dev for dev in devices} -for fd in devices: - print('Devicename:'+ devices[fd].name + ' Devicepath:' + devices[fd].fn ) +devicesNew = {} +for dev in devices: + try: + devicesNew[dev.fd] = dev + print('DONE: Devicename:'+ devicesNew[dev.fd].name + ' Devicepath:' + devicesNew[dev.fd].fn ) + except Exception as e: + print('ERROR:'+ ' ' + str(e) ) + +for fd in devicesNew: + print('Devicename:'+ devicesNew[fd].name + ' Devicepath:' + devicesNew[fd].fn ) #--- log events--- #while True: