X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gr-wxgui%2Fsrc%2Fpython%2Fpowermate.py;h=7f54dff339278db46d47c3990d7d421ef96d296c;hb=09a1e803a9e6587c78d20cdf16891e5295874668;hp=f79e22b124100b06bb7c6be663371f3789547bca;hpb=18a684bf3dc144c48fc4cc6cc72f5070febd8074;p=debian%2Fgnuradio diff --git a/gr-wxgui/src/python/powermate.py b/gr-wxgui/src/python/powermate.py index f79e22b1..7f54dff3 100755 --- a/gr-wxgui/src/python/powermate.py +++ b/gr-wxgui/src/python/powermate.py @@ -6,7 +6,7 @@ # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # # GNU Radio is distributed in the hope that it will be useful, @@ -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'