summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Thompson <rthompso@gmail.com>2013-07-03 16:00:05 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2013-07-03 16:01:29 -0700
commit5d650669a38d659724b001a6124cb8d775eaaf05 (patch)
treefd7e4bf64d3b0d3eb5ec208d9756c8dfd9fd8cb7
parent15681149e1c82e662bed75078b2577b8a57a7ee2 (diff)
grc: fix to allow grcc to execute in headless mode
-rwxr-xr-xgr-utils/python/utils/grcc3
-rw-r--r--grc/gui/Colors.py44
2 files changed, 26 insertions, 21 deletions
diff --git a/gr-utils/python/utils/grcc b/gr-utils/python/utils/grcc
index 0477b813f6..dbcc89dc0e 100755
--- a/gr-utils/python/utils/grcc
+++ b/gr-utils/python/utils/grcc
@@ -20,6 +20,9 @@
# Boston, MA 02110-1301, USA.
#
+import warnings
+warnings.simplefilter('ignore')
+
try:
from grc.python.Platform import Platform
except ImportError:
diff --git a/grc/gui/Colors.py b/grc/gui/Colors.py
index c79dadee37..5f92bb07a9 100644
--- a/grc/gui/Colors.py
+++ b/grc/gui/Colors.py
@@ -1,5 +1,5 @@
"""
-Copyright 2008 Free Software Foundation, Inc.
+Copyright 2008,2013 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
@@ -16,25 +16,27 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
+try:
+ import pygtk
+ pygtk.require('2.0')
+ import gtk
-import pygtk
-pygtk.require('2.0')
-import gtk
+ _COLORMAP = gtk.gdk.colormap_get_system() #create all of the colors
+ def get_color(color_code): return _COLORMAP.alloc_color(color_code, True, True)
-_COLORMAP = gtk.gdk.colormap_get_system() #create all of the colors
-def get_color(color_code): return _COLORMAP.alloc_color(color_code, True, True)
-
-HIGHLIGHT_COLOR = get_color('#00FFFF')
-BORDER_COLOR = get_color('black')
-#param entry boxes
-PARAM_ENTRY_TEXT_COLOR = get_color('black')
-ENTRYENUM_CUSTOM_COLOR = get_color('#EEEEEE')
-#flow graph color constants
-FLOWGRAPH_BACKGROUND_COLOR = get_color('#FFF9FF')
-#block color constants
-BLOCK_ENABLED_COLOR = get_color('#F1ECFF')
-BLOCK_DISABLED_COLOR = get_color('#CCCCCC')
-#connection color constants
-CONNECTION_ENABLED_COLOR = get_color('black')
-CONNECTION_DISABLED_COLOR = get_color('#999999')
-CONNECTION_ERROR_COLOR = get_color('red')
+ HIGHLIGHT_COLOR = get_color('#00FFFF')
+ BORDER_COLOR = get_color('black')
+ #param entry boxes
+ PARAM_ENTRY_TEXT_COLOR = get_color('black')
+ ENTRYENUM_CUSTOM_COLOR = get_color('#EEEEEE')
+ #flow graph color constants
+ FLOWGRAPH_BACKGROUND_COLOR = get_color('#FFF9FF')
+ #block color constants
+ BLOCK_ENABLED_COLOR = get_color('#F1ECFF')
+ BLOCK_DISABLED_COLOR = get_color('#CCCCCC')
+ #connection color constants
+ CONNECTION_ENABLED_COLOR = get_color('black')
+ CONNECTION_DISABLED_COLOR = get_color('#999999')
+ CONNECTION_ERROR_COLOR = get_color('red')
+except:
+ print 'Unable to import Colors'