commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10633 - gnuradio/trunk/grc/src/platforms/python


From: jblum
Subject: [Commit-gnuradio] r10633 - gnuradio/trunk/grc/src/platforms/python
Date: Tue, 17 Mar 2009 23:56:59 -0600 (MDT)

Author: jblum
Date: 2009-03-17 23:56:59 -0600 (Tue, 17 Mar 2009)
New Revision: 10633

Modified:
   gnuradio/trunk/grc/src/platforms/python/Param.py
Log:
Properly handle duplicated IDs.
Duplicates OK in disabled blocks.
Confine validation errors to blocks involved.



Modified: gnuradio/trunk/grc/src/platforms/python/Param.py
===================================================================
--- gnuradio/trunk/grc/src/platforms/python/Param.py    2009-03-17 19:56:17 UTC 
(rev 10632)
+++ gnuradio/trunk/grc/src/platforms/python/Param.py    2009-03-18 05:56:59 UTC 
(rev 10633)
@@ -215,7 +215,7 @@
                #########################
                # Enum Type
                #########################
-               if self.is_enum(): return self.get_value()
+               if self.is_enum(): return v
                #########################
                # Numeric Types
                #########################
@@ -305,7 +305,7 @@
                                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 @@
                @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()], [])





reply via email to

[Prev in Thread] Current Thread [Next in Thread]