diff options
author | Fred Drake <fdrake@acm.org> | 2000-10-23 18:09:50 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-10-23 18:09:50 (GMT) |
commit | 16f6329e6153c4b92f2175a5560e372a762befe6 (patch) | |
tree | 4d3c2f0bfe8e827ed07df59a538fa1d93bb2acb1 /Lib/xml/sax/expatreader.py | |
parent | 098b55ab4427aa546a06973cecd5e18080b546fd (diff) | |
download | cpython-16f6329e6153c4b92f2175a5560e372a762befe6.zip cpython-16f6329e6153c4b92f2175a5560e372a762befe6.tar.gz cpython-16f6329e6153c4b92f2175a5560e372a762befe6.tar.bz2 |
Make reindent.py happy (lots of trailing whitespace removed).
Diffstat (limited to 'Lib/xml/sax/expatreader.py')
-rw-r--r-- | Lib/xml/sax/expatreader.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/Lib/xml/sax/expatreader.py b/Lib/xml/sax/expatreader.py index fed5e2d..d84931e 100644 --- a/Lib/xml/sax/expatreader.py +++ b/Lib/xml/sax/expatreader.py @@ -9,7 +9,7 @@ from xml.sax._exceptions import * try: from xml.parsers import expat except ImportError: - raise SAXReaderNotAvailable("expat not supported",None) + raise SAXReaderNotAvailable("expat not supported",None) from xml.sax import xmlreader, saxutils, handler AttributesImpl = xmlreader.AttributesImpl @@ -39,12 +39,12 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): self._source = source self.reset() self._cont_handler.setDocumentLocator(self) - xmlreader.IncrementalParser.parse(self, source) + xmlreader.IncrementalParser.parse(self, source) def prepareParser(self, source): if source.getSystemId() != None: self._parser.SetBase(source.getSystemId()) - + def getFeature(self, name): if name == handler.feature_namespaces: return self._namespaces @@ -91,7 +91,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): self.feed("", isFinal = 1) self._cont_handler.endDocument() self._parsing = 0 - + def reset(self): if self._namespaces: self._parser = expat.ParserCreate(None, " ") @@ -109,17 +109,17 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): self._parser.NotationDeclHandler = self.notation_decl self._parser.StartNamespaceDeclHandler = self.start_namespace_decl self._parser.EndNamespaceDeclHandler = self.end_namespace_decl -# self._parser.CommentHandler = -# self._parser.StartCdataSectionHandler = -# self._parser.EndCdataSectionHandler = -# self._parser.DefaultHandler = -# self._parser.DefaultHandlerExpand = -# self._parser.NotStandaloneHandler = +# self._parser.CommentHandler = +# self._parser.StartCdataSectionHandler = +# self._parser.EndCdataSectionHandler = +# self._parser.DefaultHandler = +# self._parser.DefaultHandlerExpand = +# self._parser.NotStandaloneHandler = self._parser.ExternalEntityRefHandler = self.external_entity_ref self._parsing = 0 self._entity_stack = [] - + # Locator methods def getColumnNumber(self): @@ -133,7 +133,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): def getSystemId(self): return self._source.getSystemId() - + # event handlers def start_element(self, name, attrs): self._cont_handler.startElement(name, AttributesImpl(attrs)) @@ -158,14 +158,14 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): newattrs[apair] = value - self._cont_handler.startElementNS(pair, None, + self._cont_handler.startElementNS(pair, None, AttributesNSImpl(newattrs, {})) def end_element_ns(self, name): pair = string.split(name) if len(pair) == 1: pair = (None, name) - + self._cont_handler.endElementNS(pair, None) # this is not used (call directly to ContentHandler) @@ -181,7 +181,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): def end_namespace_decl(self, prefix): self._cont_handler.endPrefixMapping(prefix) - + def unparsed_entity_decl(self, name, base, sysid, pubid, notation_name): self._dtd_handler.unparsedEntityDecl(name, pubid, sysid, notation_name) @@ -193,7 +193,7 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): source = saxutils.prepare_input_source(source, self._source.getSystemId() or "") - + self._entity_stack.append((self._parser, self._source)) self._parser = self._parser.ExternalEntityParserCreate(context) self._source = source @@ -206,12 +206,12 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): (self._parser, self._source) = self._entity_stack[-1] del self._entity_stack[-1] return 1 - + # --- - + def create_parser(*args, **kwargs): return apply(ExpatParser, args, kwargs) - + # --- if __name__ == "__main__": |