Commits

Jason R. Coombs  committed 07e0f6f

Fixed issue in discovery when PyBluez is not installed

  • Participants
  • Parent commits 3686b00

Comments (0)

Files changed (2)

 ``easy_install jaraco.nxt==dev``.
 
 The ``jaraco.nxt`` library also can take advantage of the `jaraco input
-<http://pypi.python.org/pypi/jaraco.input>`_ 
+<http://pypi.python.org/pypi/jaraco.input>`_
 package.  To include it as part of the install, use the command
 ``easy_install jaraco.nxt[input]``.
 
 Changes
 -------
 
+1.3.3
+~~~~~
+
+* Fixed issue in discovery when PyBluez is not installed.
+
+1.3.2
+~~~~~
+
+* Move to Mercurial repository and bitbucket hosting.
+* Added example of reading from a sensor port.
+
 1.3.1
 ~~~~~
 

File jaraco/nxt/__init__.py

 try:
 	import bluetooth
 except ImportError:
-	class bluetooth:
-		class BluetoothSocket: pass
+	import types
+	bluetooth = types.ModuleType('bluetooth')
+	bluetooth.BluetoothSocket = type('BluetoothSocket', (object,), dict())
 	bluetooth.discover_devices = lambda *args, **kwargs: []
 
 log = logging.getLogger(__name__)
 class Connection(serial.Serial, Device):
 	"""
 	A low-level connection to an NXT brick
-	
+
 	Requires that the brick is already paired with this device using
 	Bluetooth.
-	
+
 	Example usage:
 	conn = Connection('COM3')
 	"""