summaryrefslogtreecommitdiff
path: root/grc/gui
diff options
context:
space:
mode:
authorClayton Smith <argilo@gmail.com>2020-10-12 16:35:17 -0400
committerSebastian Koslowski <sebastian.koslowski@gmail.com>2020-10-20 15:16:48 +0200
commitff22625e3b7f745f7398a2c58cb36f7f4f138453 (patch)
tree7b34c8d555e352283dd5a35a0baf26e31ba71072 /grc/gui
parent272d38407f0a7460b0e3958a8dfeb71dfb342b3e (diff)
grc: fix pylint C0326: wrong number of spaces
Diffstat (limited to 'grc/gui')
-rw-r--r--grc/gui/Application.py14
-rw-r--r--grc/gui/Dialogs.py6
-rw-r--r--grc/gui/MainWindow.py2
-rw-r--r--grc/gui/ParamWidgets.py14
-rw-r--r--grc/gui/VariableEditor.py4
-rw-r--r--grc/gui/canvas/flowgraph.py4
-rw-r--r--grc/gui/canvas/param.py2
-rw-r--r--grc/gui/canvas/port.py2
8 files changed, 24 insertions, 24 deletions
diff --git a/grc/gui/Application.py b/grc/gui/Application.py
index ed31b1103a..e512ee565f 100644
--- a/grc/gui/Application.py
+++ b/grc/gui/Application.py
@@ -311,24 +311,24 @@ class Application(Gtk.Application):
main.new_page()
flow_graph = main.current_page.flow_graph
Actions.BLOCK_PASTE()
- coords = (x_min,y_min)
+ coords = (x_min, y_min)
flow_graph.move_selected(coords)
# Set flow graph to heir block type
- top_block = flow_graph.get_block("top_block")
+ top_block = flow_graph.get_block("top_block")
top_block.params['generate_options'].set_value('hb')
# this needs to be a unique name
top_block.params['id'].set_value('new_hier')
# Remove the default samp_rate variable block that is created
- remove_me = flow_graph.get_block("samp_rate")
+ remove_me = flow_graph.get_block("samp_rate")
flow_graph.remove_element(remove_me)
# Add the param blocks along the top of the window
x_pos = 150
for param in params:
- param_id = flow_graph.add_new_block('parameter',(x_pos,10))
+ param_id = flow_graph.add_new_block('parameter', (x_pos, 10))
param_block = flow_graph.get_block(param_id)
param_block.params['id'].set_value(param)
x_pos = x_pos + 100
@@ -356,7 +356,7 @@ class Application(Gtk.Application):
pad_sink.dtype = source.dtype
# connect the pad to the proper sinks
- new_connection = flow_graph.connect(source,pad_sink)
+ new_connection = flow_graph.connect(source, pad_sink)
elif pad['direction'] == 'source':
pad_id = flow_graph.add_new_block('pad_source', pad['coord'])
@@ -610,8 +610,8 @@ class Application(Gtk.Application):
elif action == Actions.FLOW_GRAPH_OPEN:
file_paths = args[0] if args[0] else FileDialogs.OpenFlowGraph(main, page.file_path).run()
if file_paths: # Open a new page for each file, show only the first
- for i,file_path in enumerate(file_paths):
- main.new_page(file_path, show=(i==0))
+ for i, file_path in enumerate(file_paths):
+ main.new_page(file_path, show=(i == 0))
self.config.add_recent_file(file_path)
main.tool_bar.refresh_submenus()
#main.menu_bar.refresh_submenus()
diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py
index d77a32651e..eedd724e00 100644
--- a/grc/gui/Dialogs.py
+++ b/grc/gui/Dialogs.py
@@ -129,16 +129,16 @@ class TextDisplay(SimpleTextDisplay):
"""Create a popup menu for the scroll lock and clear functions"""
menu.append(Gtk.SeparatorMenuItem())
- lock = Gtk.CheckMenuItem(label = "Scroll Lock")
+ lock = Gtk.CheckMenuItem(label="Scroll Lock")
menu.append(lock)
lock.set_active(self.scroll_lock)
lock.connect('activate', self.scroll_back_cb, view)
- save = Gtk.ImageMenuItem(label = "Save Console")
+ save = Gtk.ImageMenuItem(label="Save Console")
menu.append(save)
save.connect('activate', self.save_cb, view)
- clear = Gtk.ImageMenuItem(label = "Clear Console")
+ clear = Gtk.ImageMenuItem(label="Clear Console")
menu.append(clear)
clear.connect('activate', self.clear_cb, view)
menu.show_all()
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index e55346afbe..70e5e41c08 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -64,7 +64,7 @@ class MainWindow(Gtk.ApplicationWindow):
if not icon:
# Set default window icon
self.set_icon_from_file(os.path.dirname(os.path.abspath(__file__)) + "/icon.png")
- else :
+ else:
# Use gnuradio icon
self.set_icon(icon.load_icon())
diff --git a/grc/gui/ParamWidgets.py b/grc/gui/ParamWidgets.py
index 4e3ac5f8f1..f5425bc10e 100644
--- a/grc/gui/ParamWidgets.py
+++ b/grc/gui/ParamWidgets.py
@@ -310,16 +310,16 @@ class FileParam(EntryParam):
# build the dialog
if self.param.dtype == 'file_open':
file_dialog = Gtk.FileChooserDialog(
- title = 'Open a Data File...',action = Gtk.FileChooserAction.OPEN,
+ title='Open a Data File...', action=Gtk.FileChooserAction.OPEN,
transient_for=self._transient_for,
)
- file_dialog.add_buttons( 'gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-open' , Gtk.ResponseType.OK )
+ file_dialog.add_buttons('gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-open', Gtk.ResponseType.OK)
elif self.param.dtype == 'file_save':
file_dialog = Gtk.FileChooserDialog(
- title = 'Save a Data File...',action = Gtk.FileChooserAction.SAVE,
+ title='Save a Data File...', action=Gtk.FileChooserAction.SAVE,
transient_for=self._transient_for,
)
- file_dialog.add_buttons( 'gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-save', Gtk.ResponseType.OK )
+ file_dialog.add_buttons('gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-save', Gtk.ResponseType.OK)
file_dialog.set_do_overwrite_confirmation(True)
file_dialog.set_current_name(basename) # show the current filename
else:
@@ -349,14 +349,14 @@ class DirectoryParam(FileParam):
if self.param.dtype == "dir_select": # Setup directory selection dialog, and fail for unexpected dtype
dir_dialog = Gtk.FileChooserDialog(
- title = 'Select a Directory...', action = Gtk.FileChooserAction.SELECT_FOLDER,
- transient_for = self._transient_for
+ title='Select a Directory...', action=Gtk.FileChooserAction.SELECT_FOLDER,
+ transient_for=self._transient_for
)
else:
raise ValueError("Can't open directory chooser dialog for type " + repr(self.param.dtype))
# Set dialog properties
- dir_dialog.add_buttons( 'gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-open', Gtk.ResponseType.OK )
+ dir_dialog.add_buttons('gtk-cancel', Gtk.ResponseType.CANCEL, 'gtk-open', Gtk.ResponseType.OK)
dir_dialog.set_current_folder(dirname)
dir_dialog.set_local_only(True)
dir_dialog.set_select_multiple(False)
diff --git a/grc/gui/VariableEditor.py b/grc/gui/VariableEditor.py
index 611b096e52..b243829197 100644
--- a/grc/gui/VariableEditor.py
+++ b/grc/gui/VariableEditor.py
@@ -181,13 +181,13 @@ class VariableEditor(Gtk.VBox):
# Evaluate and show the value (if it is a variable)
if block.is_variable:
# Evaluate the params
- for key in block.params :
+ for key in block.params:
evaluated = str(block.params[key].evaluate())
self.set_tooltip_text(evaluated)
# Evaluate the block value
try:
- evaluated = str( eval(block.value,block.parent.namespace,block.namespace))
+ evaluated = str(eval(block.value, block.parent.namespace, block.namespace))
self.set_tooltip_text(evaluated)
except Exception as error:
self.set_tooltip_text(str(error))
diff --git a/grc/gui/canvas/flowgraph.py b/grc/gui/canvas/flowgraph.py
index 0f4b32a942..65db00eaff 100644
--- a/grc/gui/canvas/flowgraph.py
+++ b/grc/gui/canvas/flowgraph.py
@@ -35,7 +35,7 @@ class _ContextMenu(object):
# In GTK 3.22 Menu.popup was deprecated, we want to popup at the
# pointer, so use that new function instead if we can.
- if Gtk.check_version(3,22,0) is None:
+ if Gtk.check_version(3, 22, 0) is None:
self.popup = self._menu.popup_at_pointer
def popup(self, event):
@@ -484,7 +484,7 @@ class FlowGraph(CoreFlowgraph, Drawable):
#TODO - this is a workaround for bus ports not having a proper coordinate
# until the shape is drawn. The workaround is to draw blocks before connections
- for element in filter(lambda x: x.is_block, self._elements_to_draw) :
+ for element in filter(lambda x: x.is_block, self._elements_to_draw):
element.create_shapes()
for element in filter(lambda x: not x.is_block, self._elements_to_draw):
diff --git a/grc/gui/canvas/param.py b/grc/gui/canvas/param.py
index 26a3090153..2d472e1142 100644
--- a/grc/gui/canvas/param.py
+++ b/grc/gui/canvas/param.py
@@ -70,7 +70,7 @@ class Param(CoreParam):
tooltip_lines = ['Key: ' + self.key, 'Type: ' + self.dtype]
if self.is_valid():
value = self.get_evaluated()
- if hasattr(value,"__len__"):
+ if hasattr(value, "__len__"):
tooltip_lines.append('Length: {}'.format(len(value)))
value = str(value)
if len(value) > 100:
diff --git a/grc/gui/canvas/port.py b/grc/gui/canvas/port.py
index a4566bd91f..d963964cdc 100644
--- a/grc/gui/canvas/port.py
+++ b/grc/gui/canvas/port.py
@@ -112,7 +112,7 @@ class Port(CorePort, Drawable):
label_width, label_height = self.label_layout.get_size()
self.width = 2 * Constants.PORT_LABEL_PADDING + label_width / Pango.SCALE
- self.height = (2 * Constants.PORT_LABEL_PADDING + label_height*(3 if self.dtype == 'bus' else 1) ) / Pango.SCALE
+ self.height = (2 * Constants.PORT_LABEL_PADDING + label_height*(3 if self.dtype == 'bus' else 1)) / Pango.SCALE
self._label_layout_offsets = [0, Constants.PORT_LABEL_PADDING]
self.height += self.height % 2 # uneven height