[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/03: Merge remote-tracking branch 'upstre
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/03: Merge remote-tracking branch 'upstream/next' into python3 |
Date: |
Wed, 22 Mar 2017 13:53:28 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch python3
in repository gnuradio.
commit 6299451dc055424e644f389e0e0bc0b1682fe84b
Merge: 0f38232 ad451c9
Author: Sebastian Koslowski <address@hidden>
Date: Wed Mar 22 13:23:33 2017 +0100
Merge remote-tracking branch 'upstream/next' into python3
grc/core/Param.py | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --cc grc/core/Param.py
index 9544d79,a9a664f..be86f0a
--- a/grc/core/Param.py
+++ b/grc/core/Param.py
@@@ -283,13 -480,20 +283,20 @@@ class Param(Element)
# Can python use this as a variable?
if not _check_id_matcher.match(v):
raise Exception('ID "{}" must begin with a letter and may
contain letters, numbers, and underscores.'.format(v))
- ids = [param.get_value() for param in self.get_all_params(t)]
+ ids = [param.get_value() for param in self.get_all_params(t,
'id')]
- # Id should only appear once, or zero times if block is disabled
- if ids.count(v) > 1:
- raise Exception('ID "{}" is not unique.'.format(v))
if v in ID_BLACKLIST:
raise Exception('ID "{}" is blacklisted.'.format(v))
+
- if self._key == 'id':
++ if self.key == 'id':
+ # Id should only appear once, or zero times if block is
disabled
+ if ids.count(v) > 1:
+ raise Exception('ID "{}" is not unique.'.format(v))
+ else:
+ # Id should exist to be a reference
+ if ids.count(v) < 1:
+ raise Exception('ID "{}" does not exist.'.format(v))
+
return v
#########################
@@@ -404,10 -610,7 +413,10 @@@
Returns:
a list of params
"""
- return sum([filter(lambda p: ((p.get_type() == type) and ((key is
None) or (p.get_key() == key))), block.get_params()) for block in
self.get_parent().get_parent().get_enabled_blocks()], [])
+ params = []
+ for block in self.parent_flowgraph.get_enabled_blocks():
- params.extend(p for p in block.params.values() if p.get_type() ==
type)
++ params.extend(p for k, p in block.params.items() if p.get_type()
== type and (key is None or key == k))
+ return params
def is_enum(self):
return self._type == 'enum'