MCPcopy Index your code
hub / github.com/python/cpython / ExpatParser

Class ExpatParser

Lib/xmlrpc/client.py:413–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411# XML parsers
412
413class ExpatParser:
414 # fast expat parser for Python 2.0 and later.
415 def __init__(self, target):
416 self._parser = parser = expat.ParserCreate(None, None)
417 self._target = target
418 parser.StartElementHandler = target.start
419 parser.EndElementHandler = target.end
420 parser.CharacterDataHandler = target.data
421 encoding = None
422 target.xml(encoding, None)
423
424 def feed(self, data):
425 self._parser.Parse(data, False)
426
427 def close(self):
428 try:
429 parser = self._parser
430 except AttributeError:
431 pass
432 else:
433 del self._target, self._parser # get rid of circular references
434 parser.Parse(b"", True) # end of data
435
436# --------------------------------------------------------------------
437# XML-RPC marshalling and unmarshalling code

Callers 1

getparserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…