/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/load.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/load.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 524 by jonathan, Wed Mar 12 18:26:55 2003 UTC revision 525 by jonathan, Wed Mar 12 19:12:30 2003 UTC
# Line 291  def load_session(filename): Line 291  def load_session(filename):
291      parser.setContentHandler(handler)      parser.setContentHandler(handler)
292      parser.setErrorHandler(ErrorHandler())      parser.setErrorHandler(ErrorHandler())
293      parser.setFeature(xml.sax.handler.feature_namespaces, 1)      parser.setFeature(xml.sax.handler.feature_namespaces, 1)
294      parser.setFeature(xml.sax.handler.feature_validation, 0)  
295      parser.setFeature(xml.sax.handler.feature_external_ges, 0)      #
296      parser.setFeature(xml.sax.handler.feature_external_pes, 0)      # Well, this isn't pretty, but it appears that if you
297        # use Python 2.2 without the site-package _xmlplus then
298        # the following will fail, and without them it will work.
299        # However, if you do have the site-package and you don't
300        # call these functions, the reader raises an exception
301        #
302        try:
303            parser.setFeature(xml.sax.handler.feature_validation, 0)
304            parser.setFeature(xml.sax.handler.feature_external_ges, 0)
305            parser.setFeature(xml.sax.handler.feature_external_pes, 0)
306        except SAXNotRecognizedException:
307            pass
308    
309      parser.parse(file)      parser.parse(file)
310    
311      session = handler.theSession      session = handler.theSession

Legend:
Removed from v.524  
changed lines
  Added in v.525

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26