diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/converter/block.py | 2 | ||||
-rw-r--r-- | grc/core/Messages.py | 5 | ||||
-rw-r--r-- | grc/core/blocks/block.py | 2 | ||||
-rw-r--r-- | grc/core/ports/port.py | 8 | ||||
-rw-r--r-- | grc/gui/Bars.py | 70 | ||||
-rw-r--r-- | grc/gui/canvas/block.py | 2 | ||||
-rw-r--r-- | grc/gui/canvas/flowgraph.py | 2 | ||||
-rw-r--r-- | grc/gui/canvas/param.py | 3 | ||||
-rw-r--r-- | grc/gui/external_editor.py | 2 |
9 files changed, 47 insertions, 49 deletions
diff --git a/grc/converter/block.py b/grc/converter/block.py index ebfbd5616e..369e709286 100644 --- a/grc/converter/block.py +++ b/grc/converter/block.py @@ -145,7 +145,7 @@ def convert_templates(node, convert, block_id=''): templates['make'] = make or no_value templates['callbacks'] = [ - convert(cb_node.text) for cb_node in node.iterfind('callback') + convert(cb_node.text) for cb_node in node.iterfind('callback') ] or no_value return OrderedDict((key, value) for key, value in templates.items() if value is not no_value) diff --git a/grc/core/Messages.py b/grc/core/Messages.py index b4ec496348..e6297d98c8 100644 --- a/grc/core/Messages.py +++ b/grc/core/Messages.py @@ -55,15 +55,14 @@ def send_init(platform): "Block paths:\n\t{paths}\n" send(msg.format( config=platform.config, - paths="\n\t".join(platform.config.block_paths)) - ) + paths="\n\t".join(platform.config.block_paths))) def send_xml_errors_if_any(xml_failures): if xml_failures: send('\nXML parser: Found {0} erroneous XML file{1} while loading the ' 'block tree (see "Help/Parser errors" for details)\n'.format( - len(xml_failures), 's' if len(xml_failures) > 1 else '')) + len(xml_failures), 's' if len(xml_failures) > 1 else '')) def send_start_load(file_path): diff --git a/grc/core/blocks/block.py b/grc/core/blocks/block.py index ba4eb6a8f6..58bb9606cd 100644 --- a/grc/core/blocks/block.py +++ b/grc/core/blocks/block.py @@ -255,7 +255,7 @@ class Block(Element): ) if block_requires_mode and current_generate_option not in valid_options: self.add_error_message("Can't generate this block in mode: {} ".format( - repr(current_generate_option))) + repr(current_generate_option))) check_generate_mode('QT GUI', Flags.NEED_QT_GUI, ('qt_gui', 'hb_qt_gui')) diff --git a/grc/core/ports/port.py b/grc/core/ports/port.py index d81004b9a7..36b951717f 100644 --- a/grc/core/ports/port.py +++ b/grc/core/ports/port.py @@ -212,12 +212,12 @@ class Port(Element): if self.dtype == 'bus': if self.is_sink: if (self.parent.name == con.sink_port.parent.name and - self.name == con.sink_port.name): - port_in_con = True + self.name == con.sink_port.name): + port_in_con = True elif self.is_source: if (self.parent.name == con.source_port.parent.name and - self.name == con.source_port.name): - port_in_con = True + self.name == con.source_port.name): + port_in_con = True if port_in_con: yield con diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py index 8d393db8f9..76e26537fa 100644 --- a/grc/gui/Bars.py +++ b/grc/gui/Bars.py @@ -53,39 +53,39 @@ TOOLBAR_LIST = [ # The list of actions and categories for the menu bar. MENU_BAR_LIST = [ - ('_File', [ - [(Actions.FLOW_GRAPH_NEW, 'flow_graph_new_type'), Actions.FLOW_GRAPH_DUPLICATE, - Actions.FLOW_GRAPH_OPEN, (Actions.FLOW_GRAPH_OPEN_RECENT, 'flow_graph_recent')], - [Actions.FLOW_GRAPH_SAVE, Actions.FLOW_GRAPH_SAVE_AS, Actions.FLOW_GRAPH_SAVE_COPY], - [Actions.FLOW_GRAPH_SCREEN_CAPTURE], - [Actions.FLOW_GRAPH_CLOSE, Actions.APPLICATION_QUIT] - ]), - ('_Edit', [ - [Actions.FLOW_GRAPH_UNDO, Actions.FLOW_GRAPH_REDO], - [Actions.BLOCK_CUT, Actions.BLOCK_COPY, Actions.BLOCK_PASTE, Actions.ELEMENT_DELETE, Actions.SELECT_ALL], - [Actions.BLOCK_ROTATE_CCW, Actions.BLOCK_ROTATE_CW, ('_Align', Actions.BLOCK_ALIGNMENTS)], - [Actions.BLOCK_ENABLE, Actions.BLOCK_DISABLE, Actions.BLOCK_BYPASS], - [Actions.BLOCK_PARAM_MODIFY] - ]), - ('_View', [ - [Actions.TOGGLE_BLOCKS_WINDOW], - [Actions.TOGGLE_CONSOLE_WINDOW, Actions.TOGGLE_SCROLL_LOCK, Actions.SAVE_CONSOLE, Actions.CLEAR_CONSOLE], - [Actions.TOGGLE_HIDE_VARIABLES, Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR, Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR_SIDEBAR], - [Actions.TOGGLE_HIDE_DISABLED_BLOCKS, Actions.TOGGLE_AUTO_HIDE_PORT_LABELS, Actions.TOGGLE_SNAP_TO_GRID, Actions.TOGGLE_SHOW_BLOCK_COMMENTS, Actions.TOGGLE_SHOW_BLOCK_IDS,], - [Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB], - [Actions.ERRORS_WINDOW_DISPLAY, Actions.FIND_BLOCKS], - ]), - ('_Run', [ - Actions.FLOW_GRAPH_GEN, Actions.FLOW_GRAPH_EXEC, Actions.FLOW_GRAPH_KILL - ]), - ('_Tools', [ - [Actions.TOOLS_RUN_FDESIGN, Actions.FLOW_GRAPH_OPEN_QSS_THEME], - [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.GET_INVOLVED_WINDOW_DISPLAY, Actions.ABOUT_WINDOW_DISPLAY] - ])] + ('_File', [ + [(Actions.FLOW_GRAPH_NEW, 'flow_graph_new_type'), Actions.FLOW_GRAPH_DUPLICATE, + Actions.FLOW_GRAPH_OPEN, (Actions.FLOW_GRAPH_OPEN_RECENT, 'flow_graph_recent')], + [Actions.FLOW_GRAPH_SAVE, Actions.FLOW_GRAPH_SAVE_AS, Actions.FLOW_GRAPH_SAVE_COPY], + [Actions.FLOW_GRAPH_SCREEN_CAPTURE], + [Actions.FLOW_GRAPH_CLOSE, Actions.APPLICATION_QUIT] + ]), + ('_Edit', [ + [Actions.FLOW_GRAPH_UNDO, Actions.FLOW_GRAPH_REDO], + [Actions.BLOCK_CUT, Actions.BLOCK_COPY, Actions.BLOCK_PASTE, Actions.ELEMENT_DELETE, Actions.SELECT_ALL], + [Actions.BLOCK_ROTATE_CCW, Actions.BLOCK_ROTATE_CW, ('_Align', Actions.BLOCK_ALIGNMENTS)], + [Actions.BLOCK_ENABLE, Actions.BLOCK_DISABLE, Actions.BLOCK_BYPASS], + [Actions.BLOCK_PARAM_MODIFY] + ]), + ('_View', [ + [Actions.TOGGLE_BLOCKS_WINDOW], + [Actions.TOGGLE_CONSOLE_WINDOW, Actions.TOGGLE_SCROLL_LOCK, Actions.SAVE_CONSOLE, Actions.CLEAR_CONSOLE], + [Actions.TOGGLE_HIDE_VARIABLES, Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR, Actions.TOGGLE_FLOW_GRAPH_VAR_EDITOR_SIDEBAR], + [Actions.TOGGLE_HIDE_DISABLED_BLOCKS, Actions.TOGGLE_AUTO_HIDE_PORT_LABELS, Actions.TOGGLE_SNAP_TO_GRID, Actions.TOGGLE_SHOW_BLOCK_COMMENTS, Actions.TOGGLE_SHOW_BLOCK_IDS,], + [Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB], + [Actions.ERRORS_WINDOW_DISPLAY, Actions.FIND_BLOCKS], + ]), + ('_Run', [ + Actions.FLOW_GRAPH_GEN, Actions.FLOW_GRAPH_EXEC, Actions.FLOW_GRAPH_KILL + ]), + ('_Tools', [ + [Actions.TOOLS_RUN_FDESIGN, Actions.FLOW_GRAPH_OPEN_QSS_THEME], + [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.GET_INVOLVED_WINDOW_DISPLAY, Actions.ABOUT_WINDOW_DISPLAY] + ])] # The list of actions for the context menu. @@ -94,8 +94,8 @@ CONTEXT_MENU_LIST = [ [Actions.BLOCK_ROTATE_CCW, Actions.BLOCK_ROTATE_CW, Actions.BLOCK_ENABLE, Actions.BLOCK_DISABLE, Actions.BLOCK_BYPASS], [("_More", [ [Actions.BLOCK_CREATE_HIER, Actions.OPEN_HIER], - [Actions.BUSSIFY_SOURCES, Actions.BUSSIFY_SINKS]] - )], + [Actions.BUSSIFY_SOURCES, Actions.BUSSIFY_SINKS] + ])], [Actions.BLOCK_PARAM_MODIFY], ] diff --git a/grc/gui/canvas/block.py b/grc/gui/canvas/block.py index af7f2ba9ad..3b8f479413 100644 --- a/grc/gui/canvas/block.py +++ b/grc/gui/canvas/block.py @@ -158,7 +158,7 @@ class Block(CoreBlock, Drawable): # update the params layout if not self.is_dummy_block: markups = [param.format_block_surface_markup() - for param in self.params.values() if (param.hide not in ('all', 'part') or (param.dtype == 'id' and force_show_id))] + for param in self.params.values() if (param.hide not in ('all', 'part') or (param.dtype == 'id' and force_show_id))] else: markups = ['<span font_desc="{font}"><b>key: </b>{key}</span>'.format(font=PARAM_FONT, key=self.key)] diff --git a/grc/gui/canvas/flowgraph.py b/grc/gui/canvas/flowgraph.py index 65db00eaff..03cfc9cdf8 100644 --- a/grc/gui/canvas/flowgraph.py +++ b/grc/gui/canvas/flowgraph.py @@ -280,7 +280,7 @@ class FlowGraph(CoreFlowgraph, Drawable): block.move((x_off, y_off)) while any(Utils.align_to_grid(block.coordinate) == Utils.align_to_grid(other.coordinate) - for other in self.blocks if other is not block): + for other in self.blocks if other is not block): block.move((Constants.CANVAS_GRID_SIZE, Constants.CANVAS_GRID_SIZE)) # shift all following blocks x_off += Constants.CANVAS_GRID_SIZE diff --git a/grc/gui/canvas/param.py b/grc/gui/canvas/param.py index 2d472e1142..92d1f84941 100644 --- a/grc/gui/canvas/param.py +++ b/grc/gui/canvas/param.py @@ -152,5 +152,4 @@ class Param(CoreParam): """ return '<span {foreground} font_desc="{font}"><b>{label}:</b> {value}</span>'.format( foreground='foreground="red"' if not self.is_valid() else '', font=Constants.PARAM_FONT, - label=Utils.encode(self.name), value=Utils.encode(self.pretty_print().replace('\n', ' ')) - ) + label=Utils.encode(self.name), value=Utils.encode(self.pretty_print().replace('\n', ' '))) diff --git a/grc/gui/external_editor.py b/grc/gui/external_editor.py index 96e0da7033..522b6dc4b9 100644 --- a/grc/gui/external_editor.py +++ b/grc/gui/external_editor.py @@ -28,7 +28,7 @@ class ExternalEditor(threading.Thread): def _create_tempfile(self, name, value): with tempfile.NamedTemporaryFile( - mode='wb', prefix=name + '_', suffix='.py', delete=False, + mode='wb', prefix=name + '_', suffix='.py', delete=False, ) as fp: fp.write(value.encode('utf-8')) return fp.name |