diff options
author | Tom Rondeau | 2011-09-23 17:02:45 -0400 |
---|---|---|
committer | Tom Rondeau | 2011-09-23 17:02:45 -0400 |
commit | b6f2b4138be9dc9d250dda819f901872c13876be (patch) | |
tree | 385fb5e03a3b2fa38c8728a2d68823b990b21b81 /gr-qtgui/apps/pyqt_example_f.py | |
parent | 518ba0510a6607011f2c3257dd57bf623033c0b9 (diff) | |
download | gnuradio-b6f2b4138be9dc9d250dda819f901872c13876be.tar.gz gnuradio-b6f2b4138be9dc9d250dda819f901872c13876be.tar.bz2 gnuradio-b6f2b4138be9dc9d250dda819f901872c13876be.zip |
qtgui: fixing import statements in qtgui apps to print an error if extra python modules are not available.
Diffstat (limited to 'gr-qtgui/apps/pyqt_example_f.py')
-rwxr-xr-x | gr-qtgui/apps/pyqt_example_f.py | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/gr-qtgui/apps/pyqt_example_f.py b/gr-qtgui/apps/pyqt_example_f.py index 2d957c85a..5e432fe78 100755 --- a/gr-qtgui/apps/pyqt_example_f.py +++ b/gr-qtgui/apps/pyqt_example_f.py @@ -1,9 +1,35 @@ #!/usr/bin/env python +# +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# 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 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# from gnuradio import gr -from gnuradio import qtgui -from PyQt4 import QtGui, QtCore -import sys, sip +import sys + +try: + from gnuradio import qtgui + from PyQt4 import QtGui, QtCore + import sip +except ImportError: + print "Error: Program requires PyQt4 and gr-qtgui." + sys.exit(1) class dialog_box(QtGui.QWidget): def __init__(self, display, control): |