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

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

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

revision 1170 by jonathan, Thu Jun 12 12:52:19 2003 UTC revision 2642 by bh, Fri Jul 1 20:49:04 2005 UTC
# Line 1  Line 1 
1  # Copyright (C) 2003 by Intevation GmbH  # Copyright (C) 2003, 2005 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jonathan Coles <[email protected]>  # Jonathan Coles <[email protected]>
4  #  #
# Line 15  import os Line 15  import os
15  import xml.sax  import xml.sax
16  import xml.sax.handler  import xml.sax.handler
17  from xml.sax import make_parser, ErrorHandler, SAXNotRecognizedException  from xml.sax import make_parser, ErrorHandler, SAXNotRecognizedException
18    from Thuban import internal_from_unicode
19    
20  class XMLReader(xml.sax.handler.ContentHandler):  class XMLReader(xml.sax.handler.ContentHandler):
21    
# Line 124  class XMLReader(xml.sax.handler.ContentH Line 125  class XMLReader(xml.sax.handler.ContentH
125              getattr(self, method_name[1])(name, qname)              getattr(self, method_name[1])(name, qname)
126    
127      def encode(self, str):      def encode(self, str):
128          """Assume that str is in Unicode and encode it into Latin1.          """Return the unicode object str in Thuban's internal representation
129            
130          If str is None, return None          If str is None, return None
131          """          """
132            if str is None:
         if str is not None:  
             return str.encode("latin1")  
         else:  
133              return None              return None
134            return internal_from_unicode(str)

Legend:
Removed from v.1170  
changed lines
  Added in v.2642

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26