diff options
Diffstat (limited to 'grc')
43 files changed, 68 insertions, 73 deletions
diff --git a/grc/__main__.py b/grc/__main__.py index 27a209105a..237b216ded 100644 --- a/grc/__main__.py +++ b/grc/__main__.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from .main import main diff --git a/grc/converter/__init__.py b/grc/converter/__init__.py index ae765d38d0..68b0c88990 100644 --- a/grc/converter/__init__.py +++ b/grc/converter/__init__.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from .main import Converter diff --git a/grc/converter/__main__.py b/grc/converter/__main__.py index eebf069c8b..9286d14901 100644 --- a/grc/converter/__main__.py +++ b/grc/converter/__main__.py @@ -2,8 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# # TODO: implement cli - diff --git a/grc/converter/block.py b/grc/converter/block.py index c64af95e4e..ebfbd5616e 100644 --- a/grc/converter/block.py +++ b/grc/converter/block.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# """ Converter for legacy block definitions in XML format diff --git a/grc/converter/block_tree.py b/grc/converter/block_tree.py index 39d2f2a923..407444a650 100644 --- a/grc/converter/block_tree.py +++ b/grc/converter/block_tree.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# """ Converter for legacy block tree definitions in XML format """ diff --git a/grc/converter/cheetah_converter.py b/grc/converter/cheetah_converter.py index 770a6a7f3a..62220812c6 100644 --- a/grc/converter/cheetah_converter.py +++ b/grc/converter/cheetah_converter.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import collections diff --git a/grc/converter/flow_graph.py b/grc/converter/flow_graph.py index c91b375188..c03802aaa1 100644 --- a/grc/converter/flow_graph.py +++ b/grc/converter/flow_graph.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import ast diff --git a/grc/converter/xml.py b/grc/converter/xml.py index ca8fcd5ace..eb5083dfbc 100644 --- a/grc/converter/xml.py +++ b/grc/converter/xml.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import re diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py index 93d2f932a2..d7a2bfeeee 100644 --- a/grc/core/FlowGraph.py +++ b/grc/core/FlowGraph.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import collections @@ -115,7 +115,7 @@ class FlowGraph(Element): if not section or sect == section: output.append(d) - # Sort by descending priority + # Sort by descending priority if section: output = sorted(output, key=lambda x: x['priority'], reverse=True) @@ -255,7 +255,7 @@ class FlowGraph(Element): variable_block.rewrite() value = eval(variable_block.value, namespace, variable_block.namespace) namespace[variable_block.name] = value - self.namespace.update(namespace) # rewrite on subsequent blocks depends on an updated self.namespace + self.namespace.update(namespace) # rewrite on subsequent blocks depends on an updated self.namespace except TypeError: #Type Errors may happen, but that desn't matter as they are displayed in the gui pass except Exception: @@ -317,7 +317,7 @@ class FlowGraph(Element): connection = self.parent_platform.Connection( parent=self, source=porta, sink=portb) self.connections.add(connection) - + return connection def disconnect(self, *ports): @@ -411,7 +411,7 @@ class FlowGraph(Element): block.import_data(**block_data) - self.rewrite() + self.rewrite() # build the connections def verify_and_get_port(key, block, dir): diff --git a/grc/core/Messages.py b/grc/core/Messages.py index ec2221e25a..b4ec496348 100644 --- a/grc/core/Messages.py +++ b/grc/core/Messages.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# diff --git a/grc/core/base.py b/grc/core/base.py index a5de8837d6..e92c4f923a 100644 --- a/grc/core/base.py +++ b/grc/core/base.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import weakref diff --git a/grc/core/blocks/__init__.py b/grc/core/blocks/__init__.py index 815df9f311..a80121e8bf 100644 --- a/grc/core/blocks/__init__.py +++ b/grc/core/blocks/__init__.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from ._flags import Flags diff --git a/grc/core/blocks/_build.py b/grc/core/blocks/_build.py index 690f21390f..d037d82a4b 100644 --- a/grc/core/blocks/_build.py +++ b/grc/core/blocks/_build.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import itertools diff --git a/grc/core/blocks/_templates.py b/grc/core/blocks/_templates.py index 7c84d1dbe7..c98e277feb 100644 --- a/grc/core/blocks/_templates.py +++ b/grc/core/blocks/_templates.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# """ This dict class holds a (shared) cache of compiled mako templates. These diff --git a/grc/core/blocks/dummy.py b/grc/core/blocks/dummy.py index 8445073370..75514fc235 100644 --- a/grc/core/blocks/dummy.py +++ b/grc/core/blocks/dummy.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from . import Block, register_build_in diff --git a/grc/core/blocks/embedded_python.py b/grc/core/blocks/embedded_python.py index 14535fed10..fe364f9559 100644 --- a/grc/core/blocks/embedded_python.py +++ b/grc/core/blocks/embedded_python.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from ast import literal_eval diff --git a/grc/core/blocks/virtual.py b/grc/core/blocks/virtual.py index 18f59f19d6..9d1387dbbb 100644 --- a/grc/core/blocks/virtual.py +++ b/grc/core/blocks/virtual.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import itertools diff --git a/grc/core/errors.py b/grc/core/errors.py index 675a553ba0..59f3e0c436 100644 --- a/grc/core/errors.py +++ b/grc/core/errors.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py index 1063fc8caf..204ee7e620 100644 --- a/grc/core/generator/Generator.py +++ b/grc/core/generator/Generator.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# diff --git a/grc/core/generator/__init__.py b/grc/core/generator/__init__.py index cab55645be..53bf0461f7 100644 --- a/grc/core/generator/__init__.py +++ b/grc/core/generator/__init__.py @@ -2,6 +2,6 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from .Generator import Generator diff --git a/grc/core/generator/cpp_top_block.py b/grc/core/generator/cpp_top_block.py index 9b5a8ecc1b..c2e31a55b0 100644 --- a/grc/core/generator/cpp_top_block.py +++ b/grc/core/generator/cpp_top_block.py @@ -272,11 +272,11 @@ class CppTopBlockGenerator(TopBlockGenerator): variables.remove(var) # If the type is 'raw', we'll need to evaluate the variable to infer the type. - # Create an executable fragment of code containing all 'raw' variables in + # Create an executable fragment of code containing all 'raw' variables in # order to infer the lvalue types. # - # Note that this differs from using ast.literal_eval() as literal_eval evaluates one - # variable at a time. The code fragment below evaluates all varaibles together which + # Note that this differs from using ast.literal_eval() as literal_eval evaluates one + # variable at a time. The code fragment below evaluates all varaibles together which # allows the variables to reference each other (i.e. a = b * c). prog = 'def get_decl_types():\n' prog += '\tvar_types = {}\n' @@ -314,7 +314,7 @@ class CppTopBlockGenerator(TopBlockGenerator): # Update the 'var_make' entry in the cpp_templates dictionary d = param.cpp_templates - cpp_expr = d['var_make'].replace('${value}', cpp_cmplx) + cpp_expr = d['var_make'].replace('${value}', cpp_cmplx) d.update({'var_make':cpp_expr}) param.cpp_templates = d @@ -432,7 +432,7 @@ class CppTopBlockGenerator(TopBlockGenerator): porta = con.source_port portb = con.sink_port fg = self._flow_graph - + if porta.dtype == 'bus' and portb.dtype == 'bus': # which bus port is this relative to the bus structure if len(porta.bus_structure) == len(portb.bus_structure): diff --git a/grc/core/generator/top_block.py b/grc/core/generator/top_block.py index bf7ebcc224..a8a9914108 100644 --- a/grc/core/generator/top_block.py +++ b/grc/core/generator/top_block.py @@ -308,7 +308,7 @@ class TopBlockGenerator(object): porta = con.source_port portb = con.sink_port fg = self._flow_graph - + if porta.dtype == 'bus' and portb.dtype == 'bus': # which bus port is this relative to the bus structure if len(porta.bus_structure) == len(portb.bus_structure): @@ -319,8 +319,8 @@ class TopBlockGenerator(object): parent=self, source=hidden_porta, sink=hidden_portb) code = template.render(make_port_sig=make_port_sig, source=hidden_porta, sink=hidden_portb) rendered.append(code) - - + + return rendered diff --git a/grc/core/io/__init__.py b/grc/core/io/__init__.py index 944e1c2abd..018ed9aaa2 100644 --- a/grc/core/io/__init__.py +++ b/grc/core/io/__init__.py @@ -2,4 +2,4 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# diff --git a/grc/core/params/__init__.py b/grc/core/params/__init__.py index 705d8a32e1..a43cf0aee8 100644 --- a/grc/core/params/__init__.py +++ b/grc/core/params/__init__.py @@ -2,6 +2,6 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from .param import Param diff --git a/grc/core/params/template_arg.py b/grc/core/params/template_arg.py index cb5b1b4a76..7250a71827 100644 --- a/grc/core/params/template_arg.py +++ b/grc/core/params/template_arg.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# diff --git a/grc/core/ports/clone.py b/grc/core/ports/clone.py index e0eb7f71fb..1587ec02a9 100644 --- a/grc/core/ports/clone.py +++ b/grc/core/ports/clone.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from .port import Port, Element diff --git a/grc/core/ports/port.py b/grc/core/ports/port.py index 91584c76da..d81004b9a7 100644 --- a/grc/core/ports/port.py +++ b/grc/core/ports/port.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from . import _virtual_connections @@ -40,7 +40,7 @@ class Port(Element): busses = [p for p in self.parent.ports() if p._dir == self._dir and p.dtype == 'bus'] bus_structure = self.parent.current_bus_structure[self._dir] bus_index = len(busses) - if len(bus_structure) > bus_index: + if len(bus_structure) > bus_index: number = str(len(busses)) + '#' + str(len(bus_structure[bus_index])) label = dtype + number else: @@ -207,7 +207,7 @@ class Port(Element): for con in self.parent_flowgraph.connections: #TODO clean this up - but how to get past this validation # things don't compare simply with an x in y because - # bus ports are created differently. + # bus ports are created differently. port_in_con = False if self.dtype == 'bus': if self.is_sink: @@ -218,10 +218,10 @@ class Port(Element): if (self.parent.name == con.source_port.parent.name and self.name == con.source_port.name): port_in_con = True - + if port_in_con: yield con - + else: if self in con and (enabled is None or enabled == con.enabled): yield con @@ -243,4 +243,3 @@ class Port(Element): bus_index = busses.index(self) ports = filter(lambda a: ports.index(a) in bus_structure[bus_index], ports) return ports - diff --git a/grc/core/utils/descriptors/__init__.py b/grc/core/utils/descriptors/__init__.py index a80a3dec53..66096d327d 100644 --- a/grc/core/utils/descriptors/__init__.py +++ b/grc/core/utils/descriptors/__init__.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from ._lazy import lazy_property, nop_write diff --git a/grc/core/utils/descriptors/_lazy.py b/grc/core/utils/descriptors/_lazy.py index 05d1bd9652..280b128365 100644 --- a/grc/core/utils/descriptors/_lazy.py +++ b/grc/core/utils/descriptors/_lazy.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import functools 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 index 2feff18b57..ecce5f2424 100644 --- a/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py +++ b/grc/core/utils/hide_bokeh_gui_options_if_not_installed.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# def hide_bokeh_gui_options_if_not_installed(options_blk): diff --git a/grc/gui/Application.py b/grc/gui/Application.py index ad106530c9..ed31b1103a 100644 --- a/grc/gui/Application.py +++ b/grc/gui/Application.py @@ -443,7 +443,7 @@ class Application(Gtk.Application): elif action == Actions.TYPES_WINDOW_DISPLAY: Dialogs.show_types(main) elif action == Actions.KEYBOARD_SHORTCUTS_WINDOW_DISPLAY: - Dialogs.show_keyboard_shortcuts(main) + Dialogs.show_keyboard_shortcuts(main) elif action == Actions.ERRORS_WINDOW_DISPLAY: Dialogs.ErrorsDialog(main, flow_graph).run_and_destroy() elif action == Actions.TOGGLE_CONSOLE_WINDOW: @@ -713,7 +713,7 @@ class Application(Gtk.Application): self.generator = generator except Exception as e: Messages.send_fail_gen(e) - + elif action == Actions.FLOW_GRAPH_EXEC: if not page.process: diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py index 67f77755b5..8d393db8f9 100644 --- a/grc/gui/Bars.py +++ b/grc/gui/Bars.py @@ -83,7 +83,7 @@ MENU_BAR_LIST = [ [Actions.TOGGLE_SHOW_FLOWGRAPH_COMPLEXITY] ]), ('_Help', [ - [Actions.HELP_WINDOW_DISPLAY, Actions.TYPES_WINDOW_DISPLAY, Actions.KEYBOARD_SHORTCUTS_WINDOW_DISPLAY, Actions.XML_PARSER_ERRORS_DISPLAY], + [Actions.HELP_WINDOW_DISPLAY, Actions.TYPES_WINDOW_DISPLAY, Actions.KEYBOARD_SHORTCUTS_WINDOW_DISPLAY, Actions.XML_PARSER_ERRORS_DISPLAY], [Actions.GET_INVOLVED_WINDOW_DISPLAY, Actions.ABOUT_WINDOW_DISPLAY] ])] diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index b6eed88532..d77a32651e 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import sys @@ -276,14 +276,14 @@ def show_help(parent): markup = textwrap.dedent("""\ <b>Usage Tips</b> \n\ - <u>Add block</u>: drag and drop or double click a block in the block + <u>Add block</u>: drag and drop or double click a block in the block selection window. <u>Rotate block</u>: Select a block, press left/right on the keyboard. <u>Change type</u>: Select a block, press up/down on the keyboard. <u>Edit parameters</u>: double click on a block in the flow graph. - <u>Make connection</u>: click on the source port of one block, then + <u>Make connection</u>: click on the source port of one block, then click on the sink port of another block. - <u>Remove connection</u>: select the connection and press delete, or + <u>Remove connection</u>: select the connection and press delete, or drag the connection. \n\ *Press Ctrl+K or see menu for Keyboard - Shortcuts @@ -324,12 +324,12 @@ def show_keyboard_shortcuts(parent): <u>Ctrl+D/B/R</u>: Toggle visibility of disabled blocks or connections/block tree widget/console. <u>Shift+T/M/B/L/C/R</u>: Vertical Align Top/Middle/Bottom and - Horizontal Align Left/Center/Right respectively of the + Horizontal Align Left/Center/Right respectively of the selected block. \ """) markup = markup.replace("Ctrl", Utils.get_modifier_key()) - + MessageDialogWrapper( parent, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, title='Keyboard - Shortcuts', markup=markup ).run_and_destroy() @@ -345,10 +345,10 @@ def show_get_involved(parent): You can also join our <a href="https://chat.gnuradio.org/">Matrix chat server</a>, IRC Channel (#gnuradio) or contact through our <a href="https://lists.gnu.org/mailman/listinfo/discuss-gnuradio">mailing list (discuss-gnuradio)</a>. \ """) - + MessageDialogWrapper( parent, Gtk.MessageType.QUESTION, Gtk.ButtonsType.CLOSE, title='Get - Involved', markup=markup - ).run_and_destroy() + ).run_and_destroy() def show_types(parent): @@ -364,7 +364,7 @@ def show_types(parent): MessageDialogWrapper( parent, Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, title='Types - Color Mapping', markup=message - ).run_and_destroy() + ).run_and_destroy() def show_missing_xterm(parent, xterm): diff --git a/grc/gui/Executor.py b/grc/gui/Executor.py index b3b8e6c58a..66558c96eb 100644 --- a/grc/gui/Executor.py +++ b/grc/gui/Executor.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import os diff --git a/grc/gui/ParamWidgets.py b/grc/gui/ParamWidgets.py index 6114618b52..4e3ac5f8f1 100644 --- a/grc/gui/ParamWidgets.py +++ b/grc/gui/ParamWidgets.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import os import configparser @@ -343,7 +343,7 @@ class DirectoryParam(FileParam): On success, update the entry. """ dirname = self.param.get_evaluated() if self.param.is_valid() else '' - + if not os.path.isdir(dirname): # Check if directory exists, if not fall back to workdir dirname = os.getcwd() @@ -360,7 +360,7 @@ class DirectoryParam(FileParam): dir_dialog.set_current_folder(dirname) dir_dialog.set_local_only(True) dir_dialog.set_select_multiple(False) - + # Show dialog and update paramter on success if Gtk.ResponseType.OK == dir_dialog.run(): path = dir_dialog.get_filename() @@ -370,4 +370,3 @@ class DirectoryParam(FileParam): # Cleanup dialog dir_dialog.destroy() - diff --git a/grc/gui/canvas/__init__.py b/grc/gui/canvas/__init__.py index 052694ec72..60d46fa0ad 100644 --- a/grc/gui/canvas/__init__.py +++ b/grc/gui/canvas/__init__.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from .block import Block from .connection import Connection diff --git a/grc/gui/canvas/param.py b/grc/gui/canvas/param.py index e0fd359a82..26a3090153 100644 --- a/grc/gui/canvas/param.py +++ b/grc/gui/canvas/param.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import numbers diff --git a/grc/main.py b/grc/main.py index a1231ad9d5..f3b43d662a 100755 --- a/grc/main.py +++ b/grc/main.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import argparse, logging, sys diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion index b357e74c3c..1d4af86b4c 100755 --- a/grc/scripts/gnuradio-companion +++ b/grc/scripts/gnuradio-companion @@ -3,7 +3,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import os import sys diff --git a/grc/scripts/grcc b/grc/scripts/grcc index 466b961668..e3f5df199d 100755 --- a/grc/scripts/grcc +++ b/grc/scripts/grcc @@ -3,7 +3,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import os import sys diff --git a/grc/tests/test_cheetah_converter.py b/grc/tests/test_cheetah_converter.py index 7999955436..acb0ac402c 100644 --- a/grc/tests/test_cheetah_converter.py +++ b/grc/tests/test_cheetah_converter.py @@ -129,4 +129,3 @@ def test_slurp_if(): % if abc: """ assert result == expected - diff --git a/grc/tests/test_xml_parser.py b/grc/tests/test_xml_parser.py index 44bdebb13f..cde08b29b0 100644 --- a/grc/tests/test_xml_parser.py +++ b/grc/tests/test_xml_parser.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# from os import path import sys @@ -25,4 +25,3 @@ def test_flow_graph_converter_with_fp(): data = flow_graph.from_xml(fp) flow_graph.dump(data, sys.stdout) - diff --git a/grc/tests/test_yaml_checker.py b/grc/tests/test_yaml_checker.py index 339dd87ede..0b658a1087 100644 --- a/grc/tests/test_yaml_checker.py +++ b/grc/tests/test_yaml_checker.py @@ -2,7 +2,7 @@ # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later -# +# import yaml @@ -44,7 +44,7 @@ outputs: templates: make: blocks.complex_to_mag_squared(${ vlen }) - + file_format: 1 """ |