[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/15: grc: adding param templates
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/15: grc: adding param templates |
Date: |
Thu, 10 Apr 2014 19:38:17 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 276c8a1848610d5ac2a2f50996a382cbd83d0dce
Author: Sebastian Koslowski <address@hidden>
Date: Sat Mar 29 10:22:23 2014 +0100
grc: adding param templates
---
grc/base/Block.py | 4 ++--
grc/base/Param.py | 12 ++++++++++--
grc/python/block.dtd | 3 ++-
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/grc/base/Block.py b/grc/base/Block.py
index faa48d9..5a91810 100644
--- a/grc/base/Block.py
+++ b/grc/base/Block.py
@@ -23,7 +23,7 @@ from Element import Element
from Cheetah.Template import Template
from UserDict import UserDict
-
+from itertools import imap
class TemplateArg(UserDict):
"""
@@ -103,7 +103,7 @@ class Block(Element):
'hide': 'all',
})
))
- for param in map(lambda n:
self.get_parent().get_parent().Param(block=self, n=n), params):
+ for param in imap(lambda n:
self.get_parent().get_parent().Param(block=self, n=n), params):
key = param.get_key()
#test against repeated keys
if key in self.get_param_keys():
diff --git a/grc/base/Param.py b/grc/base/Param.py
index f8bfe0d..33ba7c3 100644
--- a/grc/base/Param.py
+++ b/grc/base/Param.py
@@ -68,11 +68,19 @@ class Param(Element):
block: the parent element
n: the nested odict
"""
- #grab the data
+ # if the base key is a valid param key, copy its data and overlay this
params data
+ base_key = n.find('base_key')
+ if base_key and base_key in block.get_param_keys():
+ n_expanded = block.get_param(base_key)._n.copy()
+ n_expanded.update(n)
+ n = n_expanded
+ # save odict in case this param will be base for another
+ self._n = n
+ # parse the data
self._name = n.find('name')
self._key = n.find('key')
value = n.find('value') or ''
- self._type = n.find('type')
+ self._type = n.find('type') or 'raw'
self._hide = n.find('hide') or ''
self._tab_label = n.find('tab') or block.get_param_tab_labels()[0]
if not self._tab_label in block.get_param_tab_labels():
diff --git a/grc/python/block.dtd b/grc/python/block.dtd
index b37c0ff..18e53fd 100644
--- a/grc/python/block.dtd
+++ b/grc/python/block.dtd
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
Sub level elements.
-->
<!ELEMENT param_tab_order (tab+)>
-<!ELEMENT param (name, key, value?, type, hide?, option*, tab?)>
+<!ELEMENT param (base_key?, name, key, value?, type?, hide?, option*, tab?)>
<!ELEMENT option (name, key, opt*)>
<!ELEMENT sink (name, type, vlen?, nports?, optional?)>
<!ELEMENT source (name, type, vlen?, nports?, optional?)>
@@ -44,6 +44,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
<!ELEMENT grc_source (#PCDATA)>
<!ELEMENT tab (#PCDATA)>
<!ELEMENT name (#PCDATA)>
+<!ELEMENT base_key (#PCDATA)>
<!ELEMENT key (#PCDATA)>
<!ELEMENT check (#PCDATA)>
<!ELEMENT bus_sink (#PCDATA)>
- [Commit-gnuradio] [gnuradio] branch master updated (cd06fdc -> 4b55c7f), git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 12/15: digital: white space removal., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 10/15: grc: validate params only on focus-out, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 11/15: Merge remote-tracking branch 'mmueller/pmt_to_python-py2.6-compat', git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 06/15: Merge branch 'master' of github:gnuradio/gnuradio into pmt_to_python-py2.6-compat, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 02/15: qtgui: fixing up some minor parameters., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 09/15: grc: move FileParam to gui module, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 05/15: renamed and cleaned up a bit, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 04/15: pmt_to_python: numpy_to_uvector and reverse works, QA added, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 01/15: set numpy_mappings -> dict, to fix py2.6 incompatibility, git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 07/15: grc: adding param templates,
git <=
- [Commit-gnuradio] [gnuradio] 03/15: volk: changes QA code to use volk_malloc and volk_free., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 14/15: digital: fix for issue #663., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 15/15: digital: updated test_corr_and_sync to give time sink lines default labels., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 13/15: digital: fix for issue #664., git, 2014/04/10
- [Commit-gnuradio] [gnuradio] 08/15: qtgui: changing line config params to use base_key to make cleaner., git, 2014/04/10