Skip to content

Commit

Permalink
Clarify dependencies for python_usbtmc backend
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaus committed Aug 26, 2017
1 parent e215aa2 commit 57e281c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ Here's how to use the usbtmc shell with it:

usbtmc-shell --backend python_usbtmc USB::0x1ab1::0x0588::INSTR

To use the backend `python_usbtmc`, you need to install the requirements python-usbtmc and pyusb:
To use the backend `python_usbtmc`, you need to install the requirements [python-usbtmc][] and [PyUSB][]:

pip install https://github.com/alexforencich/python-usbtmc/archive/master.zip
pip install https://github.com/walac/pyusb/archive/master.zip
pip install python-usbtmc pyusb

The backend works on Mac OS X and Linux.

Expand Down Expand Up @@ -125,6 +124,7 @@ Off course, you need to install [PySerial][] first! The backend works on all ope
[usbtmc.c]: https://github.com/torvalds/linux/blob/master/drivers/usb/class/usbtmc.c
[PySerial]: http://pyserial.sourceforge.net/
[python-usbtmc]: https://github.com/python-ivi/python-usbtmc
[PyUSB]: https://github.com/walac/pyusb
[python-vxi11]: https://github.com/python-ivi/python-vxi11
[socket]: https://docs.python.org/3/library/socket.html
[rpi-usbtmc-gateway]: https://github.com/pklaus/rpi-usbtmc-gateway
4 changes: 3 additions & 1 deletion universal_usbtmc/backends/python_usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

import universal_usbtmc

# PyUSB from https://github.com/walac/pyusb
# python-usbtmc from https://github.com/python-ivi/python-usbtmc
try:
import usb.core
import usbtmc
except ImportError:
raise universal_usbtmc.UsbtmcMissingDependency(['python-usbtmc'])
raise universal_usbtmc.UsbtmcMissingDependency(['pyusb', 'python-usbtmc'])

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 57e281c

Please sign in to comment.