-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checks and installs pyusb and confirms compatibility with Latitude 7270 #19
base: master
Are you sure you want to change the base?
Conversation
Also: - Added a link to pip pyusb site - Added Latitude 7270 to the list of tested laptops
Thank you for taking the time to give such good feedbac. I'll have some time to make those little changes soon. |
- usb device funtions now on a separate file - nfc main function catches import exception by importing separate file - no longer attempts to install pyusb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done the requested changes. It still works great on my latitude 7270.
Thanks again for taking the time to make this project!
nfc.py
Outdated
from usbhandler import UsbDeviceFinder | ||
except ImportError as e: | ||
if e.name == 'usb': | ||
print("'usb' module note found!.\nThe 'pyusb' library is required.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Use logger (level - error) or print to stderr (
print('...', file=sys.stderr)
). - If module other than usb cannot be imported, you'd not print anything - please add
else
clause for such case, i.e.:
else:
raise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darn, you are right! Will do that now.
One thing left and I'm ready to merge it. |
This last commit prints to sderr for any inport error. And only specifically tells the user that pyusb is required when it is that library that we they are missing. Happy to delete that bit if you think it is a bit too much info. :) |
This pull would:
Feel free to edit all you want. Thanks again for taking the time to make this project happen