Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
more python 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboy2000 committed Jul 18, 2017
1 parent 0cd8ea5 commit e6347b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Adafruit_BluefruitLE/services/__init__.py
@@ -1,3 +1,3 @@
from uart import UART
from device_information import DeviceInformation
from colorific import Colorific
from .uart import UART
from .device_information import DeviceInformation
from .colorific import Colorific
6 changes: 3 additions & 3 deletions Adafruit_BluefruitLE/services/uart.py
Expand Up @@ -21,7 +21,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import Queue
import queue
import uuid

from .servicebase import ServiceBase
Expand Down Expand Up @@ -49,7 +49,7 @@ def __init__(self, device):
self._rx = self._uart.find_characteristic(RX_CHAR_UUID)
# Use a queue to pass data received from the RX property change back to
# the main thread in a thread-safe way.
self._queue = Queue.Queue()
self._queue = queue.Queue()
# Subscribe to RX characteristic changes to receive data.
self._rx.start_notify(self._rx_received)

Expand All @@ -72,6 +72,6 @@ def read(self, timeout_sec=None):
"""
try:
return self._queue.get(timeout=timeout_sec)
except Queue.Empty:
except queue.Empty:
# Timeout exceeded, return None to signify no data received.
return None
2 changes: 1 addition & 1 deletion examples/low_level.py
Expand Up @@ -80,7 +80,7 @@ def main():

# Function to receive RX characteristic changes. Note that this will
# be called on a different thread so be careful to make sure state that
# the function changes is thread safe. Use Queue or other thread-safe
# the function changes is thread safe. Use queue or other thread-safe
# primitives to send data to other threads.
def received(data):
print('Received: {0}'.format(data))
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -9,4 +9,5 @@
description = 'Python library for interacting with Bluefruit LE (Bluetooth low energy) devices on Linux or OSX.',
license = 'MIT',
url = 'https://github.com/adafruit/Adafruit_Python_BluefruitLE/',
install_requires = ['future',],
packages = find_packages())

0 comments on commit e6347b1

Please sign in to comment.