summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjblum2009-03-18 05:56:59 +0000
committerjblum2009-03-18 05:56:59 +0000
commit8760688849a4faf902de90d6d28335a1edbfcc03 (patch)
treee5a85cf85a2d29d33e06470be6461a0f0518d476
parentac543718da8ae272f863bdfb1076d5a470f9fdbf (diff)
downloadgnuradio-8760688849a4faf902de90d6d28335a1edbfcc03.tar.gz
gnuradio-8760688849a4faf902de90d6d28335a1edbfcc03.tar.bz2
gnuradio-8760688849a4faf902de90d6d28335a1edbfcc03.zip
Properly handle duplicated IDs.
Duplicates OK in disabled blocks. Confine validation errors to blocks involved. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10633 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--grc/src/platforms/python/Param.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/grc/src/platforms/python/Param.py b/grc/src/platforms/python/Param.py
index e92494bcd..efebe92e5 100644
--- a/grc/src/platforms/python/Param.py
+++ b/grc/src/platforms/python/Param.py
@@ -215,7 +215,7 @@ class Param(_Param):
#########################
# Enum Type
#########################
- if self.is_enum(): return self.get_value()
+ if self.is_enum(): return v
#########################
# Numeric Types
#########################
@@ -305,7 +305,7 @@ class Param(_Param):
raise Exception
params = self.get_all_params('id')
keys = [param.get_value() for param in params]
- try: assert(len(keys) == len(set(keys)))
+ try: assert keys.count(v) <= 1 #id should only appear once, or zero times if block is disabled
except:
self._add_error_message('ID "%s" is not unique.'%v)
raise Exception
@@ -392,4 +392,4 @@ class Param(_Param):
@param type the specified type
@return a list of params
"""
- return sum([filter(lambda p: p.get_type() == type, block.get_params()) for block in self.get_parent().get_parent().get_blocks()], [])
+ return sum([filter(lambda p: p.get_type() == type, block.get_params()) for block in self.get_parent().get_parent().get_enabled_blocks()], [])