rename grc to gnuradio-companion, matching upstream future plans
[debian/gnuradio] / grc / scripts / gnuradio-companion
1 #!/usr/bin/env python
2 """
3 Copyright 2009 Free Software Foundation, Inc.
4 This file is part of GNU Radio
5
6 GNU Radio Companion is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10
11 GNU Radio Companion is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
19 """
20
21 import pygtk
22 pygtk.require('2.0')
23 import gtk
24
25 try: from gnuradio import gr
26 except ImportError, e:
27         d = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, message_format="""
28 Cannot import gnuradio. Are your PYTHONPATH and LD_LIBRARY_PATH set correctly?""")
29         d.set_title(str(e))
30         d.run()
31         exit(-1)
32
33 from gnuradio.grc import VERSION
34 from optparse import OptionParser
35
36 if __name__ == "__main__":
37         usage = 'usage: %prog [options] [saved flow graphs]'
38         version = """
39 GNU Radio Companion %s
40
41 This program is part of GNU Radio
42 GRC comes with ABSOLUTELY NO WARRANTY.
43 This is free software,
44 and you are welcome to redistribute it.
45 """%VERSION
46         parser = OptionParser(usage=usage, version=version)
47         (options, args) = parser.parse_args()
48         from gnuradio.grc.python.Platform import Platform
49         from gnuradio.grc.gui.ActionHandler import ActionHandler
50         #setup icon using icon theme
51         try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
52         except: pass
53         ActionHandler(args, Platform())
54