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

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

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

revision 1429 by bh, Tue Jul 15 08:43:53 2003 UTC revision 1430 by jonathan, Wed Jul 16 13:23:28 2003 UTC
# Line 254  class SessionSaver(XMLWriter): Line 254  class SessionSaver(XMLWriter):
254    
255          lc = layer.GetClassification()          lc = layer.GetClassification()
256    
257          field = lc.GetField()          field = layer.GetClassificationField()
258    
259          #          #
260          # there isn't a classification of anything so do nothing          # there isn't a classification of anything so do nothing
# Line 262  class SessionSaver(XMLWriter): Line 262  class SessionSaver(XMLWriter):
262          if field is None: return          if field is None: return
263    
264          attrs["field"] = field          attrs["field"] = field
265          attrs["field_type"] = str(lc.GetFieldType())          attrs["field_type"] = str(layer.GetFieldType(field))
266          self.open_element("classification", attrs)          self.open_element("classification", attrs)
267    
268          for g in lc:          for g in lc:
# Line 270  class SessionSaver(XMLWriter): Line 270  class SessionSaver(XMLWriter):
270                  open_el  = 'clnull label="%s"' % self.encode(g.GetLabel())                  open_el  = 'clnull label="%s"' % self.encode(g.GetLabel())
271                  close_el = 'clnull'                  close_el = 'clnull'
272              elif isinstance(g, ClassGroupSingleton):              elif isinstance(g, ClassGroupSingleton):
273                  if lc.GetFieldType() == FIELDTYPE_STRING:                  if layer.GetFieldType(field) == FIELDTYPE_STRING:
274                      value = self.encode(g.GetValue())                      value = self.encode(g.GetValue())
275                  else:                  else:
276                      value = str(g.GetValue())                      value = str(g.GetValue())

Legend:
Removed from v.1429  
changed lines
  Added in v.1430

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26