diff --git a/tools_python/img2dm.py b/tools_python/img2dm.py index a2d8821..16c36f0 100644 --- a/tools_python/img2dm.py +++ b/tools_python/img2dm.py @@ -4,7 +4,7 @@ import pr import tx -from imageio import imread +from imageio.v2 import imread import sys bytes_per_frame = 20 @@ -91,6 +91,7 @@ if arg_count >= 9: pp16 = 0 # Medium size is 208*112 +# Large size is 296*128 print("Image is %i*%i in %s mode, please make sure that this suits your ESL's display." % (width, height, "color" if color_mode else "black and white")) # First pass for black and white diff --git a/tools_python/tx.py b/tools_python/tx.py index 703477a..5c75ae9 100644 --- a/tools_python/tx.py +++ b/tools_python/tx.py @@ -3,6 +3,12 @@ # See LICENSE import serial +import os +import re + +if os.name == 'posix': + from serial.tools.list_ports_posix import comports + def try_serialport(comport): try: @@ -43,6 +49,17 @@ def search_esl_blaster(): found = True break + # Mac + if found == False: + r = re.compile('usbmodem', re.I) + for info in comports(): + comport, desc, hwid = info + if r.search(comport): + result = try_serialport(comport) + if result[0]: + found = True + break + if found == False: print("Could not find ESL Blaster.") else: