(self, file)
return doc
Parse a document from a file object, returning the document
        node.
Parse a document from a file object, returning the document
        node.
Parse a document from a file object returning the document node .
def parseFile(self, file):
        """Parse a document from a file object, returning the document
        node."""
        parser = self.getParser()
        first_buffer = True
        try:
            while 1:
                buffer = file.read(16*1024)
                if not buffer:
                    break
                parser.Parse(buffer, False)
                if first_buffer and self.document.documentElement:
                    self._setup_subset(buffer)
                first_buffer = False
            parser.Parse(b"", True)
        except ParseEscape:
            pass
        doc = self.document
        self.reset()
        self._parser = None
        return doc
def parseFile ( self , file ) : parser = self . getParser ( ) first_buffer = True try : while 1 : buffer = file . read ( 16 * 1024 ) if not buffer : break parser . Parse ( buffer , False ) if first_buffer and self . document . documentElement : self . _setup_subset ( buffer ) first_buffer = False parser . Parse ( b"" , True ) except ParseEscape : pass doc = self . document self . reset ( ) self . _parser = None return doc