]> git.gag.com Git - debian/gnuradio/blobdiff - grc/base/Param.py
port and param types from an overloaded method
[debian/gnuradio] / grc / base / Param.py
index d1b22454f1c51665f81b81637dab1f1220c09b0a..21d306592c9414d0628037e801341ccd63a1ea73 100644 (file)
@@ -128,14 +128,12 @@ class Option(Element):
 
 class Param(Element):
 
-       def __init__(self, block, n, types):
+       def __init__(self, block, n):
                """
                Make a new param from nested data.
                @param block the parent element
                @param n the nested odict
-               @param types a list of possible types
                """
-               self._types = types
                #grab the data
                self._name = n.find('name')
                self._key = n.find('key')
@@ -183,7 +181,7 @@ class Param(Element):
                The value must be evaluated and type must a possible type.
                """
                Element.validate(self)
-               try: assert self.get_type() in self._types
+               try: assert self.get_type() in self.get_types()
                except AssertionError: self.add_error_message('Type "%s" is not a possible type.'%self.get_type())
 
        def get_evaluated(self): raise NotImplementedError
@@ -195,6 +193,13 @@ class Param(Element):
                """
                raise NotImplementedError
 
+       def get_types(self):
+               """
+               Get a list of all possible param types.
+               @throw NotImplementedError
+               """
+               raise NotImplementedError
+
        def get_color(self): return '#FFFFFF'
        def __str__(self): return 'Param - %s(%s)'%(self.get_name(), self.get_key())
        def is_param(self): return True