class tcolors:
GREEN = '\033[92m'
RED = '\033[91m'
+ YELLOW = '\033[93m'
BOLD = '\033[1m'
NORMAL = '\033[0m'
print(tcolors.BOLD + tcolors.GREEN + msg + tcolors.NORMAL, **kwargs)
+def print_yellow(msg, **kwargs):
+ print(tcolors.BOLD + tcolors.YELLOW + msg + tcolors.NORMAL, **kwargs)
+
+
def print_red(msg, **kwargs):
print(tcolors.BOLD + tcolors.RED + msg + tcolors.NORMAL, **kwargs)
(xfuzz is None and yfuzz is not None)):
raise InvalidConfigurationError('fuzz should be set for both axes')
- return (xfuzz, yfuzz)
+ return (int(xfuzz), int(yfuzz))
def check_axes(self):
'''
d = Device(device.path)
f = d.check_axes()
- if f is not None and fuzz == f[0] and fuzz == f[1]:
- print_green('Success')
- return True
+ if f is not None:
+ if f == (fuzz, fuzz):
+ print_yellow('Warning')
+ print_bold('The hwdb applied to the device but libinput\'s udev '
+ 'rules have not picked it up. This should only happen'
+ 'if libinput is not installed')
+ return True
+ else:
+ print_red('Error')
+ return False
else:
- print_red('Error')
- return False
+ f = d.check_property()
+ if f is not None and f == (fuzz, fuzz):
+ print_green('Success')
+ return True
+ else:
+ print_red('Error')
+ return False
def check_file_for_lines(path, template):