Ejemplo n.º 1
0
 def __init__(self, parent, child=None):
     if not isinstance(parent, IValueModule):
         raise CorruptInterface("Need a ValueModule as parent!")
     
     CConnection.__init__(self, parent, child)
         
     self._d_buffer = []
     self._d_buffer_lock = threading.Lock()
     self._d_event_threads = []
Ejemplo n.º 2
0
    def __init__(self, parent, child = None):
        """ This is the constructor of the CStreamConnection class. The 
            parameter "parent" have to be a instance of a class derived from 
            the CModule class. This instance will be handled as the parent of
            the connection. The optional parameter child defines the child of 
            the connection an have to be an instance of a class implementing 
            the IDisposable interface. If no child is give the events will be 
            disabled. """

        if not isinstance(parent, IStreamModule):
            raise CorruptInterface("The parent have to be a StreamModule!")

        if child != None and not isinstance(child, IDisposable):
            raise CorruptInterface("The child have to be a IDisposable!")

        CConnection.__init__(self, parent, child)

        self._d_buffer = ""
        self._d_buffer_lock = threading.Lock()
        self._d_event_threads = []