def fromStream(cls, input, input_type='mathml'): """Build a MathDOM from the file-like object input using the stringterm parser for input_type.""" if input_type == 'mathml': return cls(ElementTree(file=input, parser=self._parser)) else: sax_parser = SaxTerm.for_input_type(input_type) return cls.fromSax(input, sax_parser())
def fromStream(cls, input, input_type='mathml'): """Build a MathDOM from the file-like object input using the stringterm parser for input_type.""" if input_type == 'mathml': return cls( ElementTree(file=input, parser=self._parser) ) else: sax_parser = SaxTerm.for_input_type(input_type) return cls.fromSax(input, sax_parser())
def __build_sax_reader(input_type): if input_type == 'mathml': return Reader() else: sax_class = SaxTerm.for_input_type(input_type) return Reader(parser=sax_class())