Make error check code simpler for libusb1 backend.

And return the python integer instead of a c_int instance.
Raise NotImplemendError when libusb1 returns *not supported*.

Not all features of libusb 1.0 may be implemented in all platforms.
When we get a not supported error, instead of raising an USBError, we
raise a more descriptive NotImplementedError exception.
Use libusb_strerror to translate erro codes to strings.
Update decode-request-type utility to work with python 3.
Refactor the error check code.
Implement the new method clear_halt.

Clearing an endpoint halt/stall condition may require awareness of the
OS. If we bypass it and use a direct control transfer, the OS may think
the endpoint is still stalled and refuse to issue a transfer to/from it.
Disable set_feature/clear_feature test case under Windows.

We are having trouble with clear_halt call in Windows. Disable this test
until we find out what's going on.
Do not create a new array object when we already have one.

Now when as_array function receive an array object, it just returns it,
as we need to do nothing.
Allow inplace read transfers.

Now the read function can receive an output buffer of the type array
where the data transfered will be put in. This allows the buffer to be
reused for future read transfers, avoiding the overhead of creating a
new object for each call.

This is based on the original work of Marijn van Vliet (pull
request #25), but instead of creating a new function readinto, we
"overload" the read function to allow it to receive the buffer.
Support inplace data read for control transfers.

Now instead of the number of bytes for IN data stage in control
transfers, you can pass an array object to hold the data read. This
avoids the overhead of creating a new object each time we issue a
IN transfer.
Move clear_halt test case to the end.

Since clear_halt can be problematic in Windows, we move it to the end of
the tests so it cannot fail other tests.
Merge branch 'readinto'

We can now reuse buffers for read transfers.

If we give an array object in the size_or_buffer parameter instead of
the length of the read, the data read will be put into the array. The
number of bytes requested to read it equal to the buffer length times
the array.itemsize property. The returned value is the number of bytes
actually read.

closes #25.
Add 'control' module to the list exported by usb package.

'control' was not in the __all__ field for the 'usb' package. This means that
  from usb import *
  control.XXX
would fail to find the module 'control'.
Merge pull request #50 from callpraths/add_control_to_all

Add 'control' module to the list exported by usb package.
Fix array creation on Python 3.4.

On Python 3.4, you cannot mix 'B' typecode with str. We use a tuple
instead for compability with older versions of Python.

closes #51.
Fix performance regression.

Commit 01b5d9e6 introduced a performance regression: creating a tuple of
zeros is much slower than a string. For Python 2 we have to use
'\x00' * length, but for Python 3 we need b'\x00' * length.

We use a little dirty hack with encode('utf-8') method to keep
compatibility between Python 2 and 3.
wrap tutorial, comments, README at 80 chr

- most terminals are ~ 80 char wide, so this helps when reading comments
  and readme from a terminal window
- these changes were 'semi' automated using vim's 'gwip' command
- NOTE: using the --word-diff flag in git will show any changes to text
update usb core to facilitate interactive sessions

- add .descriptor and .summary properties
  shown on a terminal it is properly formatted (esp newlines)
- add Interface.endpoints that will return a list of all endpoints --
  similar properties exist for Device and Configuration
- add show_devices with a verbose flag for more information
- add _try_get_string and _try_lookup helper functions
- add _Descriptor, hidden helper subclass of str so when .descriptor is
- add lookup table for usb descriptor codes
- TODO : we are still missing the interface association descriptor
- TODO : expand _lookup to include interface subclass, protocol, etc
Rename descriptor -> info.

"info" describes better the purpose of the property, which is to show
information about the descriptor.
Comestic coding style changes.