Пример #1
0
 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())
Пример #2
0
 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())
Пример #3
0
 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())
Пример #4
0
 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())