diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2016-10-14 14:21:07 -0400 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2016-10-17 17:07:23 -0400 |
commit | bc4e0b3ba71250d92a7f45a036bcae7f5589e1a6 (patch) | |
tree | e2c7aee9699b8d87b5d9ee3b6d04ed7321e48484 /grc/gui | |
parent | 1624da7772f1ff57232e2f2024281547d483629c (diff) |
Backport GRC Python code for Python-2.6.6+
Diffstat (limited to 'grc/gui')
-rw-r--r-- | grc/gui/Block.py | 2 | ||||
-rw-r--r-- | grc/gui/Executor.py | 2 | ||||
-rw-r--r-- | grc/gui/FlowGraph.py | 2 | ||||
-rw-r--r-- | grc/gui/ParserErrorsDialog.py | 2 | ||||
-rw-r--r-- | grc/gui/PropsDialog.py | 2 | ||||
-rw-r--r-- | grc/gui/Utils.py | 2 | ||||
-rw-r--r-- | grc/gui/VariableEditor.py | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/grc/gui/Block.py b/grc/gui/Block.py index 55c8805fae..b9fc12b782 100644 --- a/grc/gui/Block.py +++ b/grc/gui/Block.py @@ -274,7 +274,7 @@ class Block(Element, _Block): # Show the flowgraph complexity on the top block if enabled if Actions.TOGGLE_SHOW_FLOWGRAPH_COMPLEXITY.get_active() and self.get_key() == "options": complexity = calculate_flowgraph_complexity(self.get_parent()) - complexity = "Complexity: {}bal".format(num_to_str(complexity)) + complexity = "Complexity: {0}bal".format(num_to_str(complexity)) layout = gtk.DrawingArea().create_pango_layout('') layout.set_markup(Utils.parse_template(COMMENT_COMPLEXITY_MARKUP_TMPL, diff --git a/grc/gui/Executor.py b/grc/gui/Executor.py index bf9eecb9a8..f91a341541 100644 --- a/grc/gui/Executor.py +++ b/grc/gui/Executor.py @@ -65,7 +65,7 @@ class ExecFlowGraphThread(threading.Thread): filename=shlex_quote(generator.file_path)) run_command_args = shlex.split(run_command) except Exception as e: - raise ValueError("Can't parse run command {!r}: {}".format(run_command, e)) + raise ValueError("Can't parse run command {!r}: {0}".format(run_command, e)) # When in no gui mode on linux, use a graphical terminal (looks nice) xterm_executable = find_executable(self.xterm_executable) diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py index f98aec41d5..44a8ae24a9 100644 --- a/grc/gui/FlowGraph.py +++ b/grc/gui/FlowGraph.py @@ -77,7 +77,7 @@ class FlowGraph(Element, _Flowgraph): a unique id """ for index in count(): - block_id = '{}_{}'.format(base_id, index) + block_id = '{0}_{1}'.format(base_id, index) if block_id not in (b.get_id() for b in self.blocks): break return block_id diff --git a/grc/gui/ParserErrorsDialog.py b/grc/gui/ParserErrorsDialog.py index 68ee459414..57485eda93 100644 --- a/grc/gui/ParserErrorsDialog.py +++ b/grc/gui/ParserErrorsDialog.py @@ -83,7 +83,7 @@ class ParserErrorsDialog(gtk.Dialog): em = self.tree_store.append(parent, ["Line {e.line}: {e.message}".format(e=error)]) if code: self.tree_store.append(em, ["\n".join( - "{} {}{}".format(line, code[line - 1].replace("\t", " ").strip("\n"), + "{0} {1}{2}".format(line, code[line - 1].replace("\t", " ").strip("\n"), " " * 20 + "<!-- ERROR -->" if line == error.line else "") for line in range(error.line - 2, error.line + 3) if 0 < line <= len(code) )]) diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py index 7c66a77a54..0e7005d7a7 100644 --- a/grc/gui/PropsDialog.py +++ b/grc/gui/PropsDialog.py @@ -265,7 +265,7 @@ class PropsDialog(gtk.Dialog): insert('\n\n# Variables\n', block.get_var_make()) insert('\n\n# Blocks\n', block.get_make()) if src: - insert('\n\n# External Code ({}.py)\n'.format(block.get_id()), src) + insert('\n\n# External Code ({0}.py)\n'.format(block.get_id()), src) def _handle_key_press(self, widget, event): """ diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py index 51b9b19e9f..80dcb4283a 100644 --- a/grc/gui/Utils.py +++ b/grc/gui/Utils.py @@ -97,7 +97,7 @@ def encode(value): character. """ - valid_utf8 = value.decode('utf-8', errors='replace').encode('utf-8') + valid_utf8 = value.decode('utf-8', 'replace').encode('utf-8') return gobject.markup_escape_text(valid_utf8) diff --git a/grc/gui/VariableEditor.py b/grc/gui/VariableEditor.py index 7721f3bda6..362a7f687d 100644 --- a/grc/gui/VariableEditor.py +++ b/grc/gui/VariableEditor.py @@ -270,7 +270,7 @@ class VariableEditor(gtk.VBox): # Create a context menu to confirm the delete operation confirmation_menu = gtk.Menu() block_id = self._block.get_param('id').get_value().replace("_", "__") - confirm = gtk.MenuItem("Delete {}".format(block_id)) + confirm = gtk.MenuItem("Delete {0}".format(block_id)) confirm.connect('activate', self.handle_action, self.DELETE_BLOCK) confirmation_menu.add(confirm) confirmation_menu.show_all() |