Author: trondeau Date: 2008-01-30 15:28:15 -0700 (Wed, 30 Jan 2008) New Revision: 7529
Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_char.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_const.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_data.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_c.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_f.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_float.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_int.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_iq.py gnuradio/trunk/gnuradio-core/src/utils/gr_plot_short.py Log: Catching ImportError exception and giving (hopefully) useful error message to install the necessary packages. Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_char.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_char.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_char.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -20,7 +20,12 @@ # Boston, MA 02110-1301, USA. # -import scipy +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + from optparse import OptionParser from gr_plot_data import plot_data Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_const.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_const.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_const.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,9 +20,19 @@ # Boston, MA 02110-1301, USA. # -import scipy -from pylab import * -from matplotlib.font_manager import fontManager, FontProperties +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +try: + from pylab import * + from matplotlib.font_manager import fontManager, FontProperties +except ImportError: + print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" + raise SystemExit, 1 + from optparse import OptionParser matplotlib.interactive(True) Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_data.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_data.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_data.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -20,8 +20,18 @@ # Boston, MA 02110-1301, USA. # -import scipy -from pylab import * +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +try: + from pylab import * +except ImportError: + print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" + raise SystemExit, 1 + from optparse import OptionParser matplotlib.interactive(True) Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_c.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_c.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_c.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,10 +20,20 @@ # Boston, MA 02110-1301, USA. # -import scipy -from pylab import * +try: + import scipy + from scipy import fftpack +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +try: + from pylab import * +except ImportError: + print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" + raise SystemExit, 1 + from optparse import OptionParser -from scipy import fftpack from math import log10 matplotlib.interactive(True) Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_f.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_f.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_f.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,10 +20,20 @@ # Boston, MA 02110-1301, USA. # -import scipy -from pylab import * +try: + import scipy + from scipy import fftpack +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +try: + from pylab import * +except ImportError: + print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" + raise SystemExit, 1 + from optparse import OptionParser -from scipy import fftpack from math import log10 matplotlib.interactive(True) Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_float.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_float.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_float.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -20,7 +20,12 @@ # Boston, MA 02110-1301, USA. # -import scipy +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + from optparse import OptionParser from gr_plot_data import plot_data Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_int.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_int.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_int.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -20,7 +20,12 @@ # Boston, MA 02110-1301, USA. # -import scipy +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + from optparse import OptionParser from gr_plot_data import plot_data Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_iq.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_iq.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_iq.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007,2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,8 +20,18 @@ # Boston, MA 02110-1301, USA. # -import scipy -from pylab import * +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + +try: + from pylab import * +except ImportError: + print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" + raise SystemExit, 1 + from optparse import OptionParser matplotlib.interactive(True) Modified: gnuradio/trunk/gnuradio-core/src/utils/gr_plot_short.py =================================================================== --- gnuradio/trunk/gnuradio-core/src/utils/gr_plot_short.py 2008-01-30 11:36:39 UTC (rev 7528) +++ gnuradio/trunk/gnuradio-core/src/utils/gr_plot_short.py 2008-01-30 22:28:15 UTC (rev 7529) @@ -20,7 +20,12 @@ # Boston, MA 02110-1301, USA. # -import scipy +try: + import scipy +except ImportError: + print "Please install SciPy to run this script (http://www.scipy.org/)" + raise SystemExit, 1 + from optparse import OptionParser from gr_plot_data import plot_data _______________________________________________ Commit-gnuradio mailing list [email protected] http://lists.gnu.org/mailman/listinfo/commit-gnuradio
