Merge branch 'bef' of http://gnuradio.org/git/trondeau
[debian/gnuradio] / grc / scripts / grc
index 94fb4294c99a3fad800ae37e3789395a55e44653..a4115c39f367d7785d6ecd991d92d74bff0e864a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 """
 #!/usr/bin/env python
 """
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2009 Free Software Foundation, Inc.
 This file is part of GNU Radio
 
 GNU Radio Companion is free software; you can redistribute it and/or
 This file is part of GNU Radio
 
 GNU Radio Companion is free software; you can redistribute it and/or
@@ -22,7 +22,15 @@ import pygtk
 pygtk.require('2.0')
 import gtk
 
 pygtk.require('2.0')
 import gtk
 
-from gnuradio.grc.platforms.base.Constants import VERSION
+try: from gnuradio import gr
+except ImportError, e:
+       d = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, message_format="""
+Cannot import gnuradio. Are your PYTHONPATH and LD_LIBRARY_PATH set correctly?""")
+       d.set_title(str(e))
+       d.run()
+       exit(-1)
+
+from gnuradio import gr
 from optparse import OptionParser
 
 if __name__ == "__main__":
 from optparse import OptionParser
 
 if __name__ == "__main__":
@@ -34,10 +42,10 @@ This program is part of GNU Radio
 GRC comes with ABSOLUTELY NO WARRANTY.
 This is free software,
 and you are welcome to redistribute it.
 GRC comes with ABSOLUTELY NO WARRANTY.
 This is free software,
 and you are welcome to redistribute it.
-"""%VERSION
+"""%gr.version()
        parser = OptionParser(usage=usage, version=version)
        (options, args) = parser.parse_args()
        parser = OptionParser(usage=usage, version=version)
        (options, args) = parser.parse_args()
-       from gnuradio.grc.platforms.python.Platform import Platform
+       from gnuradio.grc.python.Platform import Platform
        from gnuradio.grc.gui.ActionHandler import ActionHandler
        #setup icon using icon theme
        try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
        from gnuradio.grc.gui.ActionHandler import ActionHandler
        #setup icon using icon theme
        try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))