On 27/10/2019 11:58, Marcus Müller wrote:
ah! I missed the part where you said you're not used to Python.

In Python, indentation is structure-defining, and  the error message
sadly doesn't really give context, but it looks like the most probable
explanation is that the line you've inserted is not correctly indented.

Make sure you're using the same characters to indent (spaces) and the
same amount of additional spaces to indent the content of the try:-
block.

Best regards,
Marcus


Thanks Marcus,
I did not realize about indentation in python.
I have corrected this by using tabs only as used by similar structures in the same file.
On running grc I get:

[baz@jackodesktop gnuradio]$ gnuradio-companion
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/gnuradio/grc/gui/Application.py", line 102, in do_activate
    self.main_window = MainWindow(self, self.platform)
File "/usr/lib/python3.8/site-packages/gnuradio/grc/gui/MainWindow.py", line 84, in __init__
    generate_modes = platform.get_generate_options()
File "/usr/lib/python3.8/site-packages/gnuradio/grc/core/platform.py", line 379, in get_generate_options
    for param in self.block_classes['options'].parameters_data:
File "/usr/lib64/python3.8/collections/__init__.py", line 891, in __getitem__ return self.__missing__(key) # support subclasses that define __missing__ File "/usr/lib64/python3.8/collections/__init__.py", line 883, in __missing__
    raise KeyError(key)
KeyError: 'options'

The patch applying your change is attached.

Regards,
Barry



diff -ur gnuradio-3.8.0.0_o/grc/core/platform.py gnuradio-3.8.0.0/grc/core/platform.py
--- gnuradio-3.8.0.0_o/grc/core/platform.py	2019-08-09 22:40:34.000000000 +0100
+++ gnuradio-3.8.0.0/grc/core/platform.py	2019-10-29 23:00:17.161851477 +0000
@@ -194,7 +194,10 @@
 
         self._docstring_extractor.finish()
         # self._docstring_extractor.wait()
-        utils.hide_bokeh_gui_options_if_not_installed(self.blocks['options'])
+        try:
+            utils.hide_bokeh_gui_options_if_not_installed(self.blocks['options'])
+        except KeyError: #this happens if there's no 'options' block
+            pass
 
     def _iter_files_in_block_path(self, path=None, ext='yml'):
         """Iterator for block descriptions and category trees"""

Reply via email to