On Fri, Jan 20, 2012 at 11:50 AM, Xiaofan Chen <xiaof...@gmail.com> wrote: > On Sat, Jan 21, 2012 at 12:06 AM, Peter Bigot > <pabi...@users.sourceforge.net> wrote: >> OK. You haven't said whether the patch causes problems for >> libusb-compat; I assure you it's necessary for this particular version >> of legacy libusb-0.1, so if it doesn't break compat I think it should >> be installed (and if it does, then it's not as "compat" as it should >> be). >> > > The problem is that I can not test your code snippets since it > does not work on my Mac OS X Lion (libusb-compat) > and Ubuntu 11.04 (libusb-0.1 legacy) environment. > > The following codes return errors for me. > > for d in usb.core.find(find_all=True): > dev = d._ctx.dev > print '%s: %u:%u or %s:%u' % (d, d.bus, d.address, > dev.bus[0].dirname, dev.devnum) > > Could you please post your full test codes?
The only thing above that was "import usb". That code does assume that the backend is libusb01; if the error you're getting is: AttributeError: '_Device' object has no attribute 'bus' perhaps you're using libusb10 even if you think you aren't. Try the following version import usb import usb.backend.libusb01 for d in usb.core.find(find_all=True, backend=usb.backend.libusb01.get_backend()): dev = d._ctx.dev print type(dev) print '%s: %u:%u or %s:%u' % (d, d.bus, d.address, dev.bus[0].dirname, dev.devnum) When I do that, it appears the patch is correct even with libusb01 compat. Peter > > -- > Xiaofan > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > pyusb-users mailing list > pyusb-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pyusb-users ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users