Пример #1
0
 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()
Пример #2
0
 def disconnect(self):
     del self.ldo
     self.file.close()
     Sink.disconnect(self)
Пример #3
0
 def connect(self):
     self.ldo = LDOBinary.LDOBinaryMarshaler(self.file)
     self.ldo.m_init()
     Sink.connect(self)