Thor77 / Blueproximity

Run a command once a bluetooth device is in/out of a range
GNU General Public License v2.0
66 stars 15 forks source link

bluetooth module checking error #40

Open Thor77 opened 7 years ago

Thor77 commented 7 years ago

The logic for checking if python modules are working has a logic error. It runs 3 tests not 2 so the check on IMPORT_BT!=2 should say IMPORT_BT!=3: start on line 96: IMPORT_BT=0 try: import bluetooth IMPORT_BT = IMPORT_BT+1 except: pass try: import _bluetooth as bluez IMPORT_BT = IMPORT_BT+1 except: pass try: import bluetooth._bluetooth as bluez IMPORT_BT = IMPORT_BT+1 except: pass if (IMPORTBT!=3): print ("The program cannot import the module bluetooth.") print ("Please make sure the bluetooth bindings for python as well as bluez are installed.") print ("e.g. with Ubuntu Linux, type") print _(" sudo apt-get install python-bluez")