0.7 also prefer pyhidapi on linux (usb.core) still supported.

pull/1/head
Jürgen Weigert 6 years ago
parent b7f56e8c77
commit 72bb425725
  1. 6
      led-badge-11x44.py

@ -21,12 +21,12 @@
# Added builtin icons and -l to list them. # Added builtin icons and -l to list them.
# v0.6, 2019-03-14, jw Added --mode-help with hints and example for making animations. # 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. # 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 import sys, os, re, time, argparse
from array import array from array import array
try: try:
import xpyhidapi import pyhidapi
have_pyhidapi = True have_pyhidapi = True
except: except:
have_pyhidapi = False have_pyhidapi = False
@ -265,7 +265,7 @@ def bitmap_text(text):
name = m.group(1) name = m.group(1)
if name == '': if name == '':
return ':' return ':'
if name.isdecimal(): if re.match('^[0-9]*$', name): # py3 name.isdecimal()
return chr(int(name)) return chr(int(name))
if '.' in name: if '.' in name:
bitmap_preloaded.append(bitmap_img(name)) bitmap_preloaded.append(bitmap_img(name))

Loading…
Cancel
Save