commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4163 - gnuradio/trunk/gr-wxgui/src/python


From: eb
Subject: [Commit-gnuradio] r4163 - gnuradio/trunk/gr-wxgui/src/python
Date: Wed, 20 Dec 2006 12:52:04 -0700 (MST)

Author: eb
Date: 2006-12-20 12:52:04 -0700 (Wed, 20 Dec 2006)
New Revision: 4163

Modified:
   gnuradio/trunk/gr-wxgui/src/python/powermate.py
Log:
trial fix for ticket:102, import error in powermate.py under MinGW/Cygwin

Modified: gnuradio/trunk/gr-wxgui/src/python/powermate.py
===================================================================
--- gnuradio/trunk/gr-wxgui/src/python/powermate.py     2006-12-20 18:43:38 UTC 
(rev 4162)
+++ gnuradio/trunk/gr-wxgui/src/python/powermate.py     2006-12-20 19:52:04 UTC 
(rev 4163)
@@ -25,16 +25,24 @@
 
 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 @@
     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'





reply via email to

[Prev in Thread] Current Thread [Next in Thread]