diff options
-rwxr-xr-x | gr-wxgui/src/python/powermate.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gr-wxgui/src/python/powermate.py b/gr-wxgui/src/python/powermate.py index f79e22b12..041a2cd6b 100755 --- a/gr-wxgui/src/python/powermate.py +++ b/gr-wxgui/src/python/powermate.py @@ -25,16 +25,24 @@ Handler for Griffin PowerMate, Contour ShuttlePro & ShuttleXpress USB knobs This is Linux and wxPython specific. """ -import select + import os -import fcntl +import sys import struct import exceptions import threading -import sys import wx from gnuradio import gru +imported_ok = True + +try: + import select + import fcntl +except ImportError: + imported_ok = False + + # First a little bit of background: # # The Griffin PowerMate has @@ -157,6 +165,9 @@ class powermate(threading.Thread): def __init__(self, event_receiver=None, filename=None, **kwargs): self.event_receiver = event_receiver self.handle = -1 + if not imported_ok: + raise exceptions.RuntimeError, 'powermate not supported on this platform' + if filename: if not self._open_device(filename): raise exceptions.RuntimeError, 'Unable to find powermate' |