[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 20/25: grc: faulty callback code if setter
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 20/25: grc: faulty callback code if setter call contained a variable block id |
Date: |
Fri, 27 May 2016 19:14:59 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 1319af2b6cd4631a28a969a4cb54f2f25b8ab8d5
Author: Sebastian Koslowski <address@hidden>
Date: Tue May 17 13:24:54 2016 +0200
grc: faulty callback code if setter call contained a variable block id
(do-over of c85984f105106ff0a7e3b387d680e0f2f5884d55)
If a block contains a callback of the form
self.block_id.param = $param
the generators subst routine produced
self.block_id.self.param = self.param
due to a faulty splitting of the expression in expr_utils.py.
This should fix this problem by not tokenizing "VAR0.VAR1".
---
grc/core/generator/Generator.py | 5 +++--
grc/core/utils/expr_utils.py | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py
index ba272ab..fb7a3af 100644
--- a/grc/core/generator/Generator.py
+++ b/grc/core/generator/Generator.py
@@ -145,7 +145,7 @@ class TopBlockGenerator(object):
filter(lambda b: b.get_enabled() and not b.get_bypassed(),
fg.blocks),
lambda b: b.get_id(), _get_block_sort_text
)
- deprecated_block_keys = set(block.get_name() for block in blocks if
block.is_deprecated)
+ deprecated_block_keys = set(block.get_name() for block in blocks_all
if block.is_deprecated)
for key in deprecated_block_keys:
Messages.send_warning("The block {!r} is deprecated.".format(key))
@@ -224,7 +224,8 @@ class TopBlockGenerator(object):
# Map var id to callbacks
def uses_var_id():
- return expr_utils.get_variable_dependencies(callback, [var_id])
+ used = expr_utils.get_variable_dependencies(callback, [var_id])
+ return used and 'self.' + var_id in callback # callback might
contain var_id itself
callbacks = {}
for var_id in var_ids:
diff --git a/grc/core/utils/expr_utils.py b/grc/core/utils/expr_utils.py
index 240b99e..2059cef 100644
--- a/grc/core/utils/expr_utils.py
+++ b/grc/core/utils/expr_utils.py
@@ -99,7 +99,7 @@ def expr_replace(expr, replace_dict):
Returns:
a new expression with the prepend
"""
- expr_splits = expr_split(expr)
+ expr_splits = expr_split(expr, var_chars=VAR_CHARS + '.')
for i, es in enumerate(expr_splits):
if es in replace_dict.keys():
expr_splits[i] = replace_dict[es]
- [Commit-gnuradio] [gnuradio] branch master updated (681846f -> cc02c4b), git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 01/25: grc: show comments next to rotated blocks (instead of underneath), git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 22/25: Merge branch 'maint', git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 13/25: grc: Renamed reports window to console., git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 11/25: grc: Darker color for bypassed blocks., git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 04/25: grc: optionally hide all variable blocks, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 21/25: grc: function probe block: relabel and move value param, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 24/25: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 07/25: grc: remove 'Showing: ...' messages, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 12/25: grc: add warning for block flagged deprecated, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 20/25: grc: faulty callback code if setter call contained a variable block id,
git <=
- [Commit-gnuradio] [gnuradio] 14/25: Revert "grc: fix callback evaluation", git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 18/25: modtool: Added version support for OOTs, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 19/25: grc-refactor: minor clean-up of callback generator code, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 15/25: grc: fix flow graph execution (amends ActionHandler refactoring), git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 10/25: grc: Variable editor tweaks., git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 25/25: Merge remote-tracking branch 'dkozel/uhd_lo_api', git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 16/25: Added controls for importing, exporting, and sharing LOs, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 17/25: grc-refactor: fix custom canvas font sizes, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 08/25: grc: Added the variable editor panel, git, 2016/05/27
- [Commit-gnuradio] [gnuradio] 09/25: grc: Added context menu to variable editor, git, 2016/05/27