/[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 763 by bh, Tue Apr 29 10:55:26 2003 UTC revision 784 by jonathan, Tue Apr 29 17:30:18 2003 UTC
# Line 20  import xml.sax.handler Line 20  import xml.sax.handler
20  from xml.sax import make_parser, ErrorHandler, SAXNotRecognizedException  from xml.sax import make_parser, ErrorHandler, SAXNotRecognizedException
21    
22  from Thuban import _  from Thuban import _
 from Thuban.common import *  
23    
24  from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \  from Thuban.Model.table import FIELDTYPE_INT, FIELDTYPE_DOUBLE, \
25       FIELDTYPE_STRING       FIELDTYPE_STRING
# Line 228  class SessionLoader(XMLReader): Line 227  class SessionLoader(XMLReader):
227          title = attrs.get((None, 'title'), "")          title = attrs.get((None, 'title'), "")
228          filename = attrs.get((None, 'filename'), "")          filename = attrs.get((None, 'filename'), "")
229          filename = os.path.join(self.GetDirectory(), filename)          filename = os.path.join(self.GetDirectory(), filename)
230            visible  = attrs.get((None, 'visible'), "true")
231          fill = parse_color(attrs.get((None, 'fill'), "None"))          fill = parse_color(attrs.get((None, 'fill'), "None"))
232          stroke = parse_color(attrs.get((None, 'stroke'), "#000000"))          stroke = parse_color(attrs.get((None, 'stroke'), "#000000"))
233          stroke_width = int(attrs.get((None, 'stroke_width'), "1"))          stroke_width = int(attrs.get((None, 'stroke_width'), "1"))
234          self.aLayer = layer_class(title,          self.aLayer = layer_class(title,
235                                    self.theSession.OpenShapefile(filename),                                    self.theSession.OpenShapefile(filename),
236                                    fill = fill, stroke = stroke,                                    fill = fill, stroke = stroke,
237                                    lineWidth = stroke_width)                                    lineWidth = stroke_width,
238                                      visible = visible != "false")
239    
240          self.__projReceiver = self.aLayer          self.__projReceiver = self.aLayer
241    
# Line 279  class SessionLoader(XMLReader): Line 280  class SessionLoader(XMLReader):
280      def start_clpoint(self, name, qname, attrs):      def start_clpoint(self, name, qname, attrs):
281          attrib_value = attrs.get((None, 'value'), "0")          attrib_value = attrs.get((None, 'value'), "0")
282    
         #try:  
             #value  = Str2Num(attrib_value)  
         #except:  
             #value  = attrib_value  
   
283          value = self.conv(attrib_value)          value = self.conv(attrib_value)
284    
285          self.cl_group = ClassGroupSingleton(value)          self.cl_group = ClassGroupSingleton(value)
# Line 301  class SessionLoader(XMLReader): Line 297  class SessionLoader(XMLReader):
297          try:          try:
298              min = self.conv(attrs.get((None, 'min'), "0"))              min = self.conv(attrs.get((None, 'min'), "0"))
299              max = self.conv(attrs.get((None, 'max'), "0"))              max = self.conv(attrs.get((None, 'max'), "0"))
             #min = Str2Num(attrs.get((None, 'min'), "0"))  
             #max = Str2Num(attrs.get((None, 'max'), "0"))  
300          except ValueError:          except ValueError:
301              raise ValueError(_("Classification range is not a number!"))              raise ValueError(_("Classification range is not a number!"))
302    

Legend:
Removed from v.763  
changed lines
  Added in v.784

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26