def __init__(self, filename, autoconnect=True): Sink.__init__(self, autoconnect=False) if hasattr(filename, 'write'): self.file = filename self.filename = None else: self.filename = filename self.file = open(self.filename, 'wb') if autoconnect: self.connect()
def disconnect(self): del self.ldo self.file.close() Sink.disconnect(self)
def connect(self): self.ldo = LDOBinary.LDOBinaryMarshaler(self.file) self.ldo.m_init() Sink.connect(self)