[Python-checkins] CVS: python/dist/src/Lib/xml/sax expatreader.py,1.22,1.22.6.1
Tim Peters
tim_one@users.sourceforge.net
Sat, 07 Jul 2001 15:55:31 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Lib/test/output test_unicode_file,NONE,1.1.4.1 test_coercion,1.3,1.3.6.1 test_cookie,1.6,1.6.4.1 test_extcall,1.8,1.8.4.1 test_minidom,1.12,1.12.6.1 test_pyexpat,1.6,1.6.6.1 test_scope,1.6,1.6.4.1 test_copy_reg,1.1,NONE test_descr,1.1.2.1,NONE test_difflib,1.2,NONE test_doctest,1.5,NONE test_dospath,1.1,NONE test_mailbox,1.1,NONE test_parser,1.4,NONE test_sha,1.1,NONE test_strop,1.2,NONE
- Next message: [Python-checkins] CVS: python/dist/src/Modules addrinfo.h,NONE,1.1.2.1 getaddrinfo.c,NONE,1.1.2.1 getnameinfo.c,NONE,1.2.2.1 testcapi_long.h,NONE,1.2.2.1 _codecsmodule.c,2.6,2.6.8.1 _cursesmodule.c,2.51,2.51.4.1 _sre.c,2.55,2.55.4.1 _testcapimodule.c,1.3,1.3.4.1 _tkinter.c,1.115,1.115.6.1 _weakref.c,1.10,1.10.4.1 arraymodule.c,2.62,2.62.6.1 binascii.c,2.28,2.28.6.1 fcntlmodule.c,2.28,2.28.6.1 main.c,1.52,1.52.4.1 makesetup,1.35,1.35.6.1 mathmodule.c,2.58,2.58.8.1 mmapmodule.c,2.28,2.28.2.1 parsermodule.c,2.60,2.60.6.1 pcremodule.c,2.25,2.25.8.1 posixmodule.c,2.187,2.187.4.1 pyexpat.c,2.45,2.45.4.1 regexpr.c,1.33,1.33.8.1 selectmodule.c,2.50,2.50.6.1 socketmodule.c,1.141,1.141.4.1 sre.h,2.18,2.18.10.1 sre_constants.h,2.12,2.12.4.1 stropmodule.c,2.75,2.75.8.1 structmodule.c,2.42,2.42.4.1 termios.c,2.24,2.24.4.1 timemodule.c,2.110,2.110.4.1 xreadlinesmodule.c,1.5,1.5.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Lib/xml/sax
In directory usw-pr-cvs1:/tmp/cvs-serv24450/mergedescr/dist/src/Lib/xml/sax
Modified Files:
Tag: descr-branch
expatreader.py
Log Message:
Merge of trunk tag date2001-07-06 into descr-branch.
Index: expatreader.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/xml/sax/expatreader.py,v
retrieving revision 1.22
retrieving revision 1.22.6.1
diff -C2 -r1.22 -r1.22.6.1
*** expatreader.py 2001/01/27 09:01:20 1.22
--- expatreader.py 2001/07/07 22:55:29 1.22.6.1
***************
*** 7,10 ****
--- 7,17 ----
from xml.sax._exceptions import *
+
+ # xml.parsers.expat does not raise ImportError in Jython
+ import sys
+ if sys.platform[ : 4] == "java":
+ raise SAXReaderNotAvailable("expat not available in Java", None)
+ del sys
+
try:
from xml.parsers import expat
***************
*** 47,50 ****
--- 54,64 ----
self._parser.SetBase(source.getSystemId())
+ # Redefined setContentHandle to allow changing handlers during parsing
+
+ def setContentHandler(self, handler):
+ xmlreader.IncrementalParser.setContentHandler(self, handler)
+ if self._parsing:
+ self._reset_cont_handler()
+
def getFeature(self, name):
if name == handler.feature_namespaces:
***************
*** 69,72 ****
--- 83,88 ----
if name == handler.property_lexical_handler:
self._lex_handler_prop = value
+ if self._parsing:
+ self._reset_lex_handler_prop()
else:
raise SAXNotRecognizedException("Property '%s' not recognized" % name)
***************
*** 102,105 ****
--- 118,131 ----
self._parser = None
+ def _reset_cont_handler(self):
+ self._parser.ProcessingInstructionHandler = \
+ self._cont_handler.processingInstruction
+ self._parser.CharacterDataHandler = self._cont_handler.characters
+
+ def _reset_lex_handler_prop(self):
+ self._parser.CommentHandler = self._lex_handler_prop.comment
+ self._parser.StartCdataSectionHandler = self._lex_handler_prop.startCDATA
+ self._parser.EndCdataSectionHandler = self._lex_handler_prop.endCDATA
+
def reset(self):
if self._namespaces:
***************
*** 112,118 ****
self._parser.EndElementHandler = self.end_element
! self._parser.ProcessingInstructionHandler = \
! self._cont_handler.processingInstruction
! self._parser.CharacterDataHandler = self._cont_handler.characters
self._parser.UnparsedEntityDeclHandler = self.unparsed_entity_decl
self._parser.NotationDeclHandler = self.notation_decl
--- 138,142 ----
self._parser.EndElementHandler = self.end_element
! self._reset_cont_handler()
self._parser.UnparsedEntityDeclHandler = self.unparsed_entity_decl
self._parser.NotationDeclHandler = self.notation_decl
***************
*** 122,128 ****
self._decl_handler_prop = None
if self._lex_handler_prop:
! self._parser.CommentHandler = self._lex_handler_prop.comment
! self._parser.StartCdataSectionHandler = self._lex_handler_prop.startCDATA
! self._parser.EndCdataSectionHandler = self._lex_handler_prop.endCDATA
# self._parser.DefaultHandler =
# self._parser.DefaultHandlerExpand =
--- 146,150 ----
self._decl_handler_prop = None
if self._lex_handler_prop:
! self._reset_lex_handler_prop()
# self._parser.DefaultHandler =
# self._parser.DefaultHandlerExpand =
- Previous message: [Python-checkins] CVS: python/dist/src/Lib/test/output test_unicode_file,NONE,1.1.4.1 test_coercion,1.3,1.3.6.1 test_cookie,1.6,1.6.4.1 test_extcall,1.8,1.8.4.1 test_minidom,1.12,1.12.6.1 test_pyexpat,1.6,1.6.6.1 test_scope,1.6,1.6.4.1 test_copy_reg,1.1,NONE test_descr,1.1.2.1,NONE test_difflib,1.2,NONE test_doctest,1.5,NONE test_dospath,1.1,NONE test_mailbox,1.1,NONE test_parser,1.4,NONE test_sha,1.1,NONE test_strop,1.2,NONE
- Next message: [Python-checkins] CVS: python/dist/src/Modules addrinfo.h,NONE,1.1.2.1 getaddrinfo.c,NONE,1.1.2.1 getnameinfo.c,NONE,1.2.2.1 testcapi_long.h,NONE,1.2.2.1 _codecsmodule.c,2.6,2.6.8.1 _cursesmodule.c,2.51,2.51.4.1 _sre.c,2.55,2.55.4.1 _testcapimodule.c,1.3,1.3.4.1 _tkinter.c,1.115,1.115.6.1 _weakref.c,1.10,1.10.4.1 arraymodule.c,2.62,2.62.6.1 binascii.c,2.28,2.28.6.1 fcntlmodule.c,2.28,2.28.6.1 main.c,1.52,1.52.4.1 makesetup,1.35,1.35.6.1 mathmodule.c,2.58,2.58.8.1 mmapmodule.c,2.28,2.28.2.1 parsermodule.c,2.60,2.60.6.1 pcremodule.c,2.25,2.25.8.1 posixmodule.c,2.187,2.187.4.1 pyexpat.c,2.45,2.45.4.1 regexpr.c,1.33,1.33.8.1 selectmodule.c,2.50,2.50.6.1 socketmodule.c,1.141,1.141.4.1 sre.h,2.18,2.18.10.1 sre_constants.h,2.12,2.12.4.1 stropmodule.c,2.75,2.75.8.1 structmodule.c,2.42,2.42.4.1 termios.c,2.24,2.24.4.1 timemodule.c,2.110,2.110.4.1 xreadlinesmodule.c,1.5,1.5.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]