LedgerHQ / btchip-python

Ledger HW.1 Python API
http://www.ledger.co
Apache License 2.0
65 stars 51 forks source link

Remove whitespace, clean up code and fix bug. #13

Closed skorokithakis closed 9 years ago

skorokithakis commented 9 years ago

This largely removes trailing whitespace, improves a minor stylistic issue and fixes a libusb bug where a parameter changed.

btchipPersoWizard.py under Ubuntu 14.04 does not work for me without the bugfix.

btchip commented 9 years ago

Thanks, I'll look into the libusb issue in a few days. Problem is that it often depends where you get libusb from, so unless it's avaialble in an official package it's a bit messy.

skorokithakis commented 9 years ago

This fixes the issue, though. There's not even much to test, since all I did was change the parameter from a positional to a keyword parameter, so it's backwards compatible (they added an interface parameter before timeout, so the fact that it was positional made it break).

btchip commented 9 years ago

Yep, just want to check it against what Ubuntu provides, and my setup.py which should fail if the proper libusb version is not installed, so that everything is clean.

skorokithakis commented 9 years ago

Sure thing. Keyword parameters should always be preferred, as they are forwards-compatible. This pull request works on both old and new versions, whereas the version in the listed commit does not. Therefore, I would advise merging this no matter the problem, as it solves it for both versions. Thanks for the help!

btchip commented 9 years ago

Yep, good to go, thanks :)