Print tablet name when device is found

This commit is contained in:
Eric Jiang 2021-02-04 13:05:31 -08:00
parent 13e40d0025
commit 03c646b92f

View File

@ -29,12 +29,12 @@ def main():
for device_name, device_id in TABLET_MODELS.items(): for device_name, device_id in TABLET_MODELS.items():
hidraw_path = get_tablet_hidraw(device_id) hidraw_path = get_tablet_hidraw(device_id)
if hidraw_path is not None: if hidraw_path is not None:
print("Found %s at %s" % (device_name, hidraw_path))
break break
if hidraw_path is None: if hidraw_path is None:
print("Could not find tablet hidraw device") print("Could not find tablet hidraw device")
time.sleep(2) time.sleep(2)
continue continue
print("Found tablet at " + hidraw_path)
try: try:
hidraw = open(hidraw_path, 'rb') hidraw = open(hidraw_path, 'rb')
except PermissionError as e: except PermissionError as e: