From 5a83009a70bc32e3d928e3e656a823b3d0c2ccc8 Mon Sep 17 00:00:00 2001 From: James Bowman Date: Thu, 25 Apr 2019 19:46:26 -0700 Subject: [PATCH] i2cgui installed as a script, version bump to 0.0.5 --- python/i2cdriver.py | 2 +- python/samples/go | 2 +- python/samples/i2cgui.py | 11 +++++++++-- python/setup.py | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/python/i2cdriver.py b/python/i2cdriver.py index c0c15ab..e80825a 100644 --- a/python/i2cdriver.py +++ b/python/i2cdriver.py @@ -4,7 +4,7 @@ import time import struct from collections import OrderedDict -__version__ = '0.0.4' +__version__ = '0.0.5' PYTHON2 = (sys.version_info < (3, 0)) diff --git a/python/samples/go b/python/samples/go index e4f77bf..2b2402a 100644 --- a/python/samples/go +++ b/python/samples/go @@ -1,3 +1,3 @@ -python led8x8.py /dev/ttyUSB0 +python mag3110.py /dev/ttyUSB0 # python EDS-take-a-ticket.py /dev/ttyUSB0 # python i2cgui.py diff --git a/python/samples/i2cgui.py b/python/samples/i2cgui.py index 1dcfb5d..c4de7d4 100644 --- a/python/samples/i2cgui.py +++ b/python/samples/i2cgui.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import time import struct import sys @@ -9,8 +11,13 @@ from functools import partial import serial.tools.list_ports as slp import serial -import wx -import wx.lib.newevent as NE +try: + import wx + import wx.lib.newevent as NE +except ImportError: + print("i2cgui.py needs wxPython, but it wasn't found.") + print("See https://www.wxpython.org/pages/downloads/") + sys.exit(1) import i2cdriver diff --git a/python/setup.py b/python/setup.py index c5bf492..1c95953 100644 --- a/python/setup.py +++ b/python/setup.py @@ -21,4 +21,5 @@ setup(name='i2cdriver', 'i2cdriver', 'EDS', ], + scripts=['samples/i2cgui.py'], )