File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 0.0.2
2+ -----
3+
4+ * Improved search for .so file to pick up arch-specific files
5+
6+ 0.0.1
7+ -----
8+
9+ * Initial release
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ include api/core/vl53l1_api_strings.c
1111include api/core/vl53l1_api.c
1212include api/platform/vl53l1_platform.c
1313include python_lib/vl53l1x_python.c
14+ include README.rst
15+ include CHANGELOG.txt
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ PYTHON_VERSIONS=(
4+ " 3.5"
5+ " 3.4"
6+ " 2.7"
7+ )
8+
9+ for (( i = 0 ; i < ${# PYTHON_VERSIONS[@]} ; i++ )) ; do
10+ PYTHON_VERSION=" ${PYTHON_VERSIONS[$i]} "
11+ PYTHON_PATH=" /usr/bin/python$PYTHON_VERSION "
12+ printf " Building for Python $PYTHON_VERSION \n"
13+ $PYTHON_PATH setup.py bdist_wheel
14+ done
15+
Original file line number Diff line number Diff line change 2525from smbus2 import SMBus , i2c_msg
2626import os
2727import site
28+ import glob
2829
2930class VL53L1xError (RuntimeError ):
3031 pass
@@ -40,19 +41,23 @@ class VL53L1xDistanceMode:
4041
4142# Load VL53L1X shared lib
4243_POSSIBLE_LIBRARY_LOCATIONS = [os .path .dirname (os .path .realpath (__file__ ))] + site .getsitepackages ()
44+
4345try :
4446 _POSSIBLE_LIBRARY_LOCATIONS += [site .getusersitepackages ()]
4547except AttributeError :
4648 pass
4749
4850for lib_location in _POSSIBLE_LIBRARY_LOCATIONS :
49- try :
50- _TOF_LIBRARY = CDLL (lib_location + "/vl53l1x_python.so" )
51- #print("Using: " + lib_location + "/vl51l1x_python.so")
52- break
53- except OSError :
54- #print(lib_location + "/vl51l1x_python.so not found")
55- pass
51+ files = glob .glob (lib_location + "/vl53l1x_python*.so" )
52+ if len (files ) > 0 :
53+ lib_file = files [0 ]
54+ try :
55+ _TOF_LIBRARY = CDLL (lib_file )
56+ #print("Using: " + lib_location + "/vl51l1x_python.so")
57+ break
58+ except OSError :
59+ #print(lib_location + "/vl51l1x_python.so not found")
60+ pass
5661else :
5762 raise OSError ('Could not find vl53l1x_python.so' )
5863
Original file line number Diff line number Diff line change 2222 'python_lib/vl53l1x_python.c' ])
2323
2424setup (name = 'VL53L1X' ,
25- version = '0.0.1 ' ,
25+ version = '0.0.2 ' ,
2626 description = 'vl53l1x distance sensor driver for Raspberry Pi' ,
2727 # author='?',
2828 # author_email='?',
2929 url = 'https://github.com/pimoroni/vl53l1x-python' ,
30- long_description = '''
31- vl53l1x sensor for Raspberry Pi.
32- ''' ,
30+ long_description = open ('README.md' ).read () + "\n " + open ('CHANGELOG.txt' ).read (),
3331 ext_modules = [extension ],
3432 package_dir = {'' : 'python' },
3533 py_modules = ['VL53L1X' ],
You can’t perform that action at this time.
0 commit comments