summaryrefslogtreecommitdiff
path: root/gr-wxgui/src/python
diff options
context:
space:
mode:
authoreb2006-12-20 19:52:04 +0000
committereb2006-12-20 19:52:04 +0000
commit566df7b80d836b42b75b63d9a0704a04b387115a (patch)
treed365292d2481a457ce67570b23680d9dfad119c8 /gr-wxgui/src/python
parent781eb41b703f3b15c3106167e02e01cf0b336ffd (diff)
downloadgnuradio-566df7b80d836b42b75b63d9a0704a04b387115a.tar.gz
gnuradio-566df7b80d836b42b75b63d9a0704a04b387115a.tar.bz2
gnuradio-566df7b80d836b42b75b63d9a0704a04b387115a.zip
trial fix for ticket:102, import error in powermate.py under MinGW/Cygwin
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4163 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-wxgui/src/python')
-rwxr-xr-xgr-wxgui/src/python/powermate.py17
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'