From: <fwi...@us...> - 2009-08-10 17:17:42
|
Revision: 6645 http://jython.svn.sourceforge.net/jython/?rev=6645&view=rev Author: fwierzbicki Date: 2009-08-10 17:17:35 +0000 (Mon, 10 Aug 2009) Log Message: ----------- Trivial reindents. Modified Paths: -------------- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py Modified: trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py =================================================================== --- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2009-08-10 17:16:57 UTC (rev 6644) +++ trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2009-08-10 17:17:35 UTC (rev 6645) @@ -35,7 +35,7 @@ jaxp = 1 except ImportError: jaxp = 0 - + from java.lang import String @@ -50,7 +50,7 @@ class JyErrorHandlerWrapper(javasax.ErrorHandler): def __init__(self, err_handler): self._err_handler = err_handler - + def error(self, exc): self._err_handler.error(_wrap_sax_exception(exc)) @@ -105,7 +105,7 @@ self.lineNum = lineNum self.pubId = pubId self.sysId = sysId - + def getColumnNumber(self): return self.colNum @@ -265,7 +265,7 @@ def get(self, name, alt=None): try: - return self.getValue(name) + return self.getValue(name) except KeyError: return alt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pj...@us...> - 2010-04-02 01:56:21
|
Revision: 6997 http://jython.svn.sourceforge.net/jython/?rev=6997&view=rev Author: pjenvey Date: 2010-04-02 01:56:15 +0000 (Fri, 02 Apr 2010) Log Message: ----------- better fix for #1583 with the changed unicode handling Modified Paths: -------------- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py Modified: trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py =================================================================== --- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-02 01:42:07 UTC (rev 6996) +++ trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-02 01:56:15 UTC (rev 6997) @@ -185,10 +185,11 @@ self._cont_handler.startPrefixMapping(prefix, uri) def characters(self, char, start, len): - self._cont_handler.characters(String(char, start, len).getBytes('utf-8').tostring().decode('utf-8')) + self._cont_handler.characters(unicode(String(char, start, len))) def ignorableWhitespace(self, char, start, len): - self._cont_handler.ignorableWhitespace(String(char, start, len).getBytes('utf-8').tostring().decode('utf-8')) + self._cont_handler.ignorableWhitespace(unicode(String(char, start, + len))) def endElement(self, uri, lname, qname): if self._namespaces: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2010-04-16 18:13:01
|
Revision: 7028 http://jython.svn.sourceforge.net/jython/?rev=7028&view=rev Author: amak Date: 2010-04-16 18:12:55 +0000 (Fri, 16 Apr 2010) Log Message: ----------- Fix for bug 1488: sax JyInputSourceWrapper does not support unicode strings Thanks to Arthur Noel for the report and fix. Modified Paths: -------------- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py Modified: trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py =================================================================== --- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-16 17:37:44 UTC (rev 7027) +++ trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-16 18:12:55 UTC (rev 7028) @@ -63,7 +63,7 @@ class JyInputSourceWrapper(javasax.InputSource): def __init__(self, source): - if isinstance(source, str): + if isinstance(source, basestring): javasax.InputSource.__init__(self, source) elif hasattr(source, "read"):#file like object f = source @@ -212,6 +212,7 @@ self._cont_handler.processingInstruction(target, data) def comment(self, char, start, len): + print "Content handler is %s" % self._cont_handler.__class__ self._cont_handler.comment(unicode(String(char, start, len))) class AttributesImpl: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2010-04-16 18:22:48
|
Revision: 7029 http://jython.svn.sourceforge.net/jython/?rev=7029&view=rev Author: amak Date: 2010-04-16 18:22:42 +0000 (Fri, 16 Apr 2010) Log Message: ----------- Accidentally left in a debug statement. Modified Paths: -------------- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py Modified: trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py =================================================================== --- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-16 18:12:55 UTC (rev 7028) +++ trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-16 18:22:42 UTC (rev 7029) @@ -212,7 +212,6 @@ self._cont_handler.processingInstruction(target, data) def comment(self, char, start, len): - print "Content handler is %s" % self._cont_handler.__class__ self._cont_handler.comment(unicode(String(char, start, len))) class AttributesImpl: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <am...@us...> - 2010-04-16 18:50:09
|
Revision: 7030 http://jython.svn.sourceforge.net/jython/?rev=7030&view=rev Author: amak Date: 2010-04-16 18:50:03 +0000 (Fri, 16 Apr 2010) Log Message: ----------- A full set of handlers for the LexicalHandler methods. Some will need to be implemented, e.g. the startCDATA and endCDATA methods. Modified Paths: -------------- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py Modified: trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py =================================================================== --- trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-16 18:22:42 UTC (rev 7029) +++ trunk/jython/Lib/xml/sax/drivers2/drv_javasax.py 2010-04-16 18:50:03 UTC (rev 7030) @@ -211,9 +211,32 @@ def processingInstruction(self, target, data): self._cont_handler.processingInstruction(target, data) + # Lexical handler methods def comment(self, char, start, len): - self._cont_handler.comment(unicode(String(char, start, len))) + try: + # Need to wrap this in a try..except in case the parser does not support lexical events + self._cont_handler.comment(unicode(String(char, start, len))) + except: + pass + def startCDATA(self): + pass # TODO + + def endCDATA(self): + pass # TODO + + def startDTD(self, name, publicId, systemId): + pass # TODO + + def endDTD(self): + pass # TODO + + def startEntity(self, name): + pass # TODO + + def endEntity(self, name): + pass # TODO + class AttributesImpl: def __init__(self, attrs = None): self._attrs = attrs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |