DanAnkers/python-ant — pull request #1 by donalm (2012-01-17 11:35:14+00:00)
Title: USB2Driver fixes

I ran into the following two exceptions when trying to run 01-reset.py (having modified it to use USB2Driver). My changes allow the script to run - it still hangs indefinitely on antnode.start() but I assume that's unrelated.

Traceback (most recent call last):
File "01-reset.py", line 25, in
antnode.start()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/node.py", line 158, in start
self.driver.open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 61, in open
self._open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 194, in _open
alternate_setting = usb.control.get_interface(dev, interface_number)
AttributeError: 'module' object has no attribute 'control'

=============================================

Traceback (most recent call last):
File "01-reset.py", line 25, in
antnode.start()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/node.py", line 158, in start
self.driver.open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 62, in open
self._open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 198, in _open
AlternateSetting = alternate_setting
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/util.py", line 176, in find_descriptor
return _interop._next(desc_iter(k, v))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/_interop.py", line 60, in _next
return next(iter)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/util.py", line 164, in desc_iter
map(lambda i: getattr(d, i), k)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/util.py", line 164, in
map(lambda i: getattr(d, i), k)
AttributeError: 'Interface' object has no attribute 'AlternateSetting'