コード例 #1
0
ファイル: libxml.py プロジェクト: Baines1986/Personal-Site
    def __init__(self, _obj, enc = ""):
#        print "ioWriteWrapper.__init__", _obj
        if type(_obj) == type(''):
            print("write io from a string")
            self.o = None
        elif type(_obj).__name__ == 'PyCapsule':
            file = libxml2mod.outputBufferGetPythonFile(_obj)
            if file != None:
                ioWrapper.__init__(self, file)
            else:
                ioWrapper.__init__(self, _obj)
            self._o = _obj
#        elif type(_obj) == types.InstanceType:
#            print(("write io from instance of %s" % (_obj.__class__)))
#            ioWrapper.__init__(self, _obj)
#            self._o = libxml2mod.xmlCreateOutputBuffer(self, enc)
        else:
            file = libxml2mod.outputBufferGetPythonFile(_obj)
            if file != None:
                ioWrapper.__init__(self, file)
            else:
                ioWrapper.__init__(self, _obj)
            self._o = _obj
コード例 #2
0
    def __init__(self, _obj, enc = ""):
#        print "ioWriteWrapper.__init__", _obj
        if type(_obj) == type(''):
            print("write io from a string")
            self.o = None
        elif type(_obj).__name__ == 'PyCapsule':
            file = libxml2mod.outputBufferGetPythonFile(_obj)
            if file != None:
                ioWrapper.__init__(self, file)
            else:
                ioWrapper.__init__(self, _obj)
            self._o = _obj
#        elif type(_obj) == types.InstanceType:
#            print(("write io from instance of %s" % (_obj.__class__)))
#            ioWrapper.__init__(self, _obj)
#            self._o = libxml2mod.xmlCreateOutputBuffer(self, enc)
        else:
            file = libxml2mod.outputBufferGetPythonFile(_obj)
            if file != None:
                ioWrapper.__init__(self, file)
            else:
                ioWrapper.__init__(self, _obj)
            self._o = _obj
コード例 #3
0
 def __init__(self, _obj, enc=""):
     #        print "ioWriteWrapper.__init__", _obj
     if type(_obj) == type(""):
         print "write io from a string"
         self.o = None
     elif type(_obj) == types.InstanceType:
         print "write io from instance of %s" % (_obj.__class__)
         ioWrapper.__init__(self, _obj)
         self._o = libxml2mod.xmlCreateOutputBuffer(self, enc)
     else:
         file = libxml2mod.outputBufferGetPythonFile(_obj)
         if file != None:
             ioWrapper.__init__(self, file)
         else:
             ioWrapper.__init__(self, _obj)
         self._o = _obj