From cf2a4f174bb49a6c9e839217369b1e22741a10da Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 15 Jan 2013 14:30:39 +0100 Subject: grc: Fixed Bug #485 by gracefully exiting when user sets GR_DONT_LOAD_PREFS=1 GRC_BLOCKS_PATH= --- grc/scripts/gnuradio-companion | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'grc/scripts') 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 -- cgit