Changeset 7529

Show
Ignore:
Timestamp:
01/30/08 15:28:15
Author:
trondeau
Message:

Catching ImportError? exception and giving (hopefully) useful error message to install the necessary packages.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_char.py

    r7528 r7529  
    2121#  
    2222 
    23 import scipy 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
    2429from optparse import OptionParser 
    2530from gr_plot_data import plot_data 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_const.py

    r7528 r7529  
    11#!/usr/bin/env python 
    22# 
    3 # Copyright 2007 Free Software Foundation, Inc. 
     3# Copyright 2007,2008 Free Software Foundation, Inc. 
    44#  
    55# This file is part of GNU Radio 
     
    2121#  
    2222 
    23 import scipy 
    24 from pylab import * 
    25 from matplotlib.font_manager import fontManager, FontProperties 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
     29try: 
     30    from pylab import * 
     31    from matplotlib.font_manager import fontManager, FontProperties 
     32except ImportError: 
     33    print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" 
     34    raise SystemExit, 1 
     35 
    2636from optparse import OptionParser 
    2737 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_data.py

    r7528 r7529  
    2121#  
    2222 
    23 import scipy 
    24 from pylab import * 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
     29try: 
     30    from pylab import * 
     31except ImportError: 
     32    print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" 
     33    raise SystemExit, 1 
     34 
    2535from optparse import OptionParser 
    2636 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_c.py

    r7528 r7529  
    11#!/usr/bin/env python 
    22# 
    3 # Copyright 2007 Free Software Foundation, Inc. 
     3# Copyright 2007,2008 Free Software Foundation, Inc. 
    44#  
    55# This file is part of GNU Radio 
     
    2121#  
    2222 
    23 import scipy 
    24 from pylab import * 
     23try: 
     24    import scipy 
     25    from scipy import fftpack 
     26except ImportError: 
     27    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     28    raise SystemExit, 1 
     29 
     30try: 
     31    from pylab import * 
     32except ImportError: 
     33    print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" 
     34    raise SystemExit, 1 
     35 
    2536from optparse import OptionParser 
    26 from scipy import fftpack 
    2737from math import log10 
    2838 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_fft_f.py

    r7528 r7529  
    11#!/usr/bin/env python 
    22# 
    3 # Copyright 2007 Free Software Foundation, Inc. 
     3# Copyright 2007,2008 Free Software Foundation, Inc. 
    44#  
    55# This file is part of GNU Radio 
     
    2121#  
    2222 
    23 import scipy 
    24 from pylab import * 
     23try: 
     24    import scipy 
     25    from scipy import fftpack 
     26except ImportError: 
     27    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     28    raise SystemExit, 1 
     29 
     30try: 
     31    from pylab import * 
     32except ImportError: 
     33    print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" 
     34    raise SystemExit, 1 
     35 
    2536from optparse import OptionParser 
    26 from scipy import fftpack 
    2737from math import log10 
    2838 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_float.py

    r7528 r7529  
    2121#  
    2222 
    23 import scipy 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
    2429from optparse import OptionParser 
    2530from gr_plot_data import plot_data 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_int.py

    r7528 r7529  
    2121#  
    2222 
    23 import scipy 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
    2429from optparse import OptionParser 
    2530from gr_plot_data import plot_data 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_iq.py

    r7528 r7529  
    11#!/usr/bin/env python 
    22# 
    3 # Copyright 2007 Free Software Foundation, Inc. 
     3# Copyright 2007,2008 Free Software Foundation, Inc. 
    44#  
    55# This file is part of GNU Radio 
     
    2121#  
    2222 
    23 import scipy 
    24 from pylab import * 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
     29try: 
     30    from pylab import * 
     31except ImportError: 
     32    print "Please install Matplotlib to run this script (http://matplotlib.sourceforge.net/)" 
     33    raise SystemExit, 1 
     34 
    2535from optparse import OptionParser 
    2636 
  • gnuradio/trunk/gnuradio-core/src/utils/gr_plot_short.py

    r7528 r7529  
    2121#  
    2222 
    23 import scipy 
     23try: 
     24    import scipy 
     25except ImportError: 
     26    print "Please install SciPy to run this script (http://www.scipy.org/)" 
     27    raise SystemExit, 1 
     28 
    2429from optparse import OptionParser 
    2530from gr_plot_data import plot_data