Merge branch 'makefile_var_ordering'
[debian/gnuradio] / grc / base / Port.py
index 8e60d50931c3e91f60203c6d3c93c9d911c472f4..494ea894f7bdcf55551fc403845472b3aef1207d 100644 (file)
@@ -21,9 +21,6 @@ from Element import Element
 
 class Port(Element):
 
-       ##possible port types
-       TYPES = []
-
        def __init__(self, block, n, dir):
                """
                Make a new port from nested data.
@@ -45,7 +42,7 @@ class Port(Element):
                The port must be non-empty 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 __str__(self):
@@ -54,6 +51,13 @@ class Port(Element):
                if self.is_sink():
                        return 'Sink - %s(%s)'%(self.get_name(), self.get_key())
 
+       def get_types(self):
+               """
+               Get a list of all possible port types.
+               @throw NotImplementedError
+               """
+               raise NotImplementedError
+
        def is_port(self): return True
        def get_color(self): return '#FFFFFF'
        def get_name(self): return self._name