[libhid-discuss] Various libhid improvements

Charles Lepple clepple at ghz.cc
Sat Jan 20 18:47:16 CET 2007


On Jan 20, 2007, at 12:08 AM, Andreas Klöckner wrote:

> Hi there,
>
> I've made two improvements to libhid's Python wrapper:
>
> - If any part of a path does not fit into 31 bits (signed int),  
> Python makes
> that part a long integer. The attached patch lets the wrapper deal  
> with that.

Applied. I hadn't thought of that corner case.

> - I've written a small wrapper-around-the-wrapper that makes it  
> even easier to
> use the libhid wrapper from Python. The example program becomes:

Excellent.

> ----------------------------------------------------
> def main():
>     import hidwrap
>     import sys
>
>     hidwrap.set_debug(hidwrap.HID_DEBUG_ALL)
>     hidwrap.set_debug_stream(sys.stderr)
>     hidwrap.set_usb_debug(0)
>
>     iface = hidwrap.Interface(vendor_id=0x3351, product_id=0x3715)
>     iface.write_identification(sys.stdout)
>     iface.dump_tree(sys.stdout)
>
> if __name__ == '__main__':
>     main()
> ----------------------------------------------------

I added this as test_hidwrap.py. When I fix my SWIG setup, I will  
merge in Martin's code fragment from test_libhid.py that looks for  
the local _hid.so (so that you don't have to do a 'make install' to  
test against the latest code).

Thanks for your contribution!

-- 
Charles Lepple





More information about the libhid-discuss mailing list