From 72bb425725f96925550f96fc80cbfa4b4c825fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Weigert?= Date: Mon, 20 May 2019 12:00:49 +0200 Subject: [PATCH] 0.7 also prefer pyhidapi on linux (usb.core) still supported. --- led-badge-11x44.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/led-badge-11x44.py b/led-badge-11x44.py index bba1303..3e25686 100755 --- a/led-badge-11x44.py +++ b/led-badge-11x44.py @@ -21,12 +21,12 @@ # Added builtin icons and -l to list them. # v0.6, 2019-03-14, jw Added --mode-help with hints and example for making animations. # Options -b --blink, -a --ants added. Removed -p from usage. -# v0.7, 2019-05-20, jw Support pyhidapi, fallback to usb.core. +# v0.7, 2019-05-20, jw Support pyhidapi, fallback to usb.core. Added python2 compatibility. import sys, os, re, time, argparse from array import array try: - import xpyhidapi + import pyhidapi have_pyhidapi = True except: have_pyhidapi = False @@ -265,7 +265,7 @@ def bitmap_text(text): name = m.group(1) if name == '': return ':' - if name.isdecimal(): + if re.match('^[0-9]*$', name): # py3 name.isdecimal() return chr(int(name)) if '.' in name: bitmap_preloaded.append(bitmap_img(name))