diff options
author | Martin Braun | 2013-01-15 14:30:39 +0100 |
---|---|---|
committer | Martin Braun | 2013-01-15 14:39:27 +0100 |
commit | cf2a4f174bb49a6c9e839217369b1e22741a10da (patch) | |
tree | e82dd1405696fed1627a13dd59cba1bd5516ab2d /grc | |
parent | 6f7a9120c08badd42175737faaa896d001073fad (diff) | |
download | gnuradio-cf2a4f174bb49a6c9e839217369b1e22741a10da.tar.gz gnuradio-cf2a4f174bb49a6c9e839217369b1e22741a10da.tar.bz2 gnuradio-cf2a4f174bb49a6c9e839217369b1e22741a10da.zip |
grc: Fixed Bug #485 by gracefully exiting when user sets GR_DONT_LOAD_PREFS=1 GRC_BLOCKS_PATH=
Diffstat (limited to 'grc')
-rw-r--r-- | grc/gui/MainWindow.py | 3 | ||||
-rwxr-xr-x | grc/scripts/gnuradio-companion | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py index 37a100c94..1dc02dabb 100644 --- a/grc/gui/MainWindow.py +++ b/grc/gui/MainWindow.py @@ -180,6 +180,9 @@ class MainWindow(gtk.Window): if file_path: Messages.send_end_load() except Exception, e: #return on failure Messages.send_fail_load(e) + if isinstance(e, KeyError) and str(e) == "'options'": + # This error is unrecoverable, so crash gracefully + exit(-1) return #add this page to the notebook self.notebook.append_page(page, page.get_tab()) diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion index e76322b4d..dabca3028 100755 --- a/grc/scripts/gnuradio-companion +++ b/grc/scripts/gnuradio-companion @@ -39,10 +39,19 @@ Is the library path environment variable set correctly? d.run() exit(-1) -from gnuradio import gr from optparse import OptionParser +import os if __name__ == "__main__": + if ('GR_DONT_LOAD_PREFS' in os.environ.keys() and + (not 'GRC_BLOCKS_PATH' in os.environ.keys() or len(os.environ['GRC_BLOCKS_PATH']) == 0)): + d = gtk.MessageDialog( + type=gtk.MESSAGE_ERROR, + buttons=gtk.BUTTONS_CLOSE, + message_format="""Can't find block definitions. Use config.conf or GRC_BLOCKS_PATH. """) + d.set_title("No block definitions available.") + d.run() + exit(-1) usage = 'usage: %prog [options] [saved flow graphs]' version = """ GNU Radio Companion %s |