summaryrefslogtreecommitdiff
path: root/grc/core/utils
diff options
context:
space:
mode:
authorSebastian Koslowski <sebastian.koslowski@gmail.com>2017-08-30 20:17:52 +0200
committerSebastian Koslowski <sebastian.koslowski@gmail.com>2017-08-30 20:17:52 +0200
commit6a6eabc465c24e75f701b1e3d0033769ae76f736 (patch)
tree4058afdd804f1a48ab9ee3fb9660280cb5b828e5 /grc/core/utils
parent1375fe38dd7ff6bcaffc25aed9b990a64cdb9c03 (diff)
parentc0f18d38456df2e0ad97bc90a2435601530d8ea1 (diff)
Merge branch 'master' into next
Diffstat (limited to 'grc/core/utils')
-rw-r--r--grc/core/utils/__init__.py1
-rw-r--r--grc/core/utils/hide_bokeh_gui_options_if_not_installed.py28
2 files changed, 29 insertions, 0 deletions
diff --git a/grc/core/utils/__init__.py b/grc/core/utils/__init__.py
index 6b23da2723..2aed42d762 100644
--- a/grc/core/utils/__init__.py
+++ b/grc/core/utils/__init__.py
@@ -20,3 +20,4 @@ import epy_block_io
import extract_docs
from odict import odict
+from hide_bokeh_gui_options_if_not_installed import hide_bokeh_gui_options_if_not_installed
diff --git a/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py b/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py
new file mode 100644
index 0000000000..fc0141851a
--- /dev/null
+++ b/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py
@@ -0,0 +1,28 @@
+# Copyright 2008-2017 Free Software Foundation, Inc.
+# This file is part of GNU Radio
+#
+# GNU Radio Companion is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# GNU Radio Companion is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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
+
+
+def hide_bokeh_gui_options_if_not_installed(options):
+ try:
+ import bokehgui
+ except ImportError:
+ generate_option = options.get_param('generate_options')
+ list_generate_option = generate_option.get_options()
+ for option in list_generate_option:
+ if option.get_key() == 'bokeh_gui':
+ list_generate_option.remove(option)
+ return