[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/08: grc: stop overwritting modified para
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/08: grc: stop overwritting modified param values in epy blocks |
Date: |
Tue, 5 Apr 2016 23:29:12 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 44b038bb2133cd5bdbd2683c7a4a6145abb2396c
Author: Sebastian Koslowski <address@hidden>
Date: Tue Apr 5 09:29:27 2016 +0200
grc: stop overwritting modified param values in epy blocks
---
grc/base/Param.py | 6 ++++--
grc/python/Block.py | 7 +++----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/grc/base/Param.py b/grc/base/Param.py
index b246d9f..34dd36e 100644
--- a/grc/base/Param.py
+++ b/grc/base/Param.py
@@ -154,8 +154,10 @@ class Param(Element):
def set_value(self, value): self._value = str(value) #must be a string
- def value_is_default(self):
- return self._default == self._value
+ def set_default(self, value):
+ if self._default == self._value:
+ self.set_value(value)
+ self._default = str(value)
def get_type(self): return
self.get_parent().resolve_dependencies(self._type)
def get_tab_label(self): return self._tab_label
diff --git a/grc/python/Block.py b/grc/python/Block.py
index f5c994d..4118fda 100644
--- a/grc/python/Block.py
+++ b/grc/python/Block.py
@@ -279,11 +279,10 @@ class Block(_Block, _GUIBlock):
self._params.remove(param)
for key, value in blk_io.params:
- if key in params:
+ try:
param = params[key]
- if not param.value_is_default():
- param.set_value(value)
- else:
+ param.set_default(value)
+ except KeyError: # need to make a new param
name = key.replace('_', ' ').title()
n = odict(dict(name=name, key=key, type='raw', value=value))
param = platform.Param(block=self, n=n)
- [Commit-gnuradio] [gnuradio] branch maint updated (0341203 -> d0eab54), git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 02/08: ctrlport: change to doc; no -p flag required for gr-perf-monitorx, git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 03/08: grc: stop overwritting modified param values in epy blocks,
git <=
- [Commit-gnuradio] [gnuradio] 08/08: Merge remote-tracking branch 'gnuradio-wg-grc/maint_grcwg' into maint, git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 05/08: grc: ignore xml comments in block wrappers, git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 06/08: grc: fix bug #856: paging/scrolling from keyboard, git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 01/08: ctrlport: change to doc; no -p flag required for gr-ctrlport-monitor, git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 04/08: grc: rewrite block before adding connections during flowgraph import, git, 2016/04/05
- [Commit-gnuradio] [gnuradio] 07/08: Merge remote-tracking branch 'tracierenea/ctrlport_doc' into maint, git, 2016/04/05