/[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 2615 by jonathan, Fri May 6 14:17:03 2005 UTC revision 2658 by jan, Wed Jul 27 21:50:30 2005 UTC
# Line 1  Line 1 
1  # Copyright (C) 2001, 2002, 2003, 2004 by Intevation GmbH  # Copyright (C) 2001, 2002, 2003, 2004, 2005 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jan-Oliver Wagner <[email protected]>  # Jan-Oliver Wagner <[email protected]>
4  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
# Line 248  class SessionLoader(XMLReader): Line 248  class SessionLoader(XMLReader):
248                                      % (element, d.name))                                      % (element, d.name))
249              elif d.conversion == "filename":              elif d.conversion == "filename":
250                  value = os.path.abspath(os.path.join(self.GetDirectory(),                  value = os.path.abspath(os.path.join(self.GetDirectory(),
251                                                       value))                                                       self.encode(value)))
252              elif d.conversion == "ascii":              elif d.conversion == "ascii":
253                  value = value.encode("ascii")                  value = value.encode("ascii")
254              elif d.conversion:              elif d.conversion:
# Line 525  class SessionLoader(XMLReader): Line 525  class SessionLoader(XMLReader):
525          self.aLayer = None          self.aLayer = None
526    
527      def start_classification(self, name, qname, attrs):      def start_classification(self, name, qname, attrs):
528            # field and field_type are optional because the classification
529            # can also be empty, ie. have only a default.
530          attrs = self.check_attrs(name, attrs,          attrs = self.check_attrs(name, attrs,
531                                   [AttrDesc("field", True),                                   [AttrDesc("field", False),
532                                    AttrDesc("field_type", True)])                                    AttrDesc("field_type", False)])
533    
534          field = attrs["field"]          field = attrs["field"]
535          fieldType = attrs["field_type"]          fieldType = attrs["field_type"]
536    
537            if field == "": return # no need to set classification column.
538    
539          dbFieldType = self.aLayer.GetFieldType(field)          dbFieldType = self.aLayer.GetFieldType(field)
540    
541          if fieldType != dbFieldType:          if fieldType != dbFieldType:
# Line 579  class SessionLoader(XMLReader): Line 584  class SessionLoader(XMLReader):
584          del self.cl_group, self.cl_prop          del self.cl_group, self.cl_prop
585    
586      def start_clrange(self, name, qname, attrs):      def start_clrange(self, name, qname, attrs):
587            attrs = self.check_attrs(name, attrs,
588                                     [AttrDesc("range", False, None),
589                                      AttrDesc("min", False, None),
590                                      AttrDesc("max", False, None)])
591    
592          range = attrs.get((None, 'range'), None)          range = attrs['range']
593          # for backward compatibility (min/max are not saved)          # for backward compatibility (min/max are not saved)
594          min   = attrs.get((None, 'min'), None)          min   = attrs['min']
595          max   = attrs.get((None, 'max'), None)          max   = attrs['max']
596    
597          try:          try:
598              if range is not None:              if range is not None:

Legend:
Removed from v.2615  
changed lines
  Added in v.2658

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26