diff options
Diffstat (limited to 'dev_add')
-rwxr-xr-x | dev_add | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -12,11 +12,14 @@ import sys import time def dev_match(evpath, pattern, logger): + name = '(null)' + phys = '(null)' + try: with open(evpath + '/device/name', 'r') as f: - name = f.read() + name = f.read().strip() with open(evpath + '/device/phys', 'r') as f: - phys = f.read() + phys = f.read().strip() if not 'uinput' in phys and re.search(pattern, name): logger.debug('%s matched the pattern', evpath) @@ -24,7 +27,7 @@ def dev_match(evpath, pattern, logger): except IOError: pass - logger.debug('%s did not match the pattern', evpath) + logger.debug('%s (%s | %s) did not match the pattern', evpath, name, phys) return False def dev_add(control, syspath, logger): |