/[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 1970 by bh, Mon Nov 24 18:36:00 2003 UTC revision 2034 by bh, Mon Dec 22 16:35:16 2003 UTC
# Line 143  class SessionLoader(XMLReader): Line 143  class SessionLoader(XMLReader):
143          for xmlns in ("http://thuban.intevation.org/dtds/thuban-0.8.dtd",          for xmlns in ("http://thuban.intevation.org/dtds/thuban-0.8.dtd",
144                        "http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd",                        "http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd",
145                        "http://thuban.intevation.org/dtds/thuban-0.9.dtd",                        "http://thuban.intevation.org/dtds/thuban-0.9.dtd",
146                        "http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"):                        "http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd",
147                          "http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"):
148              for key, value in dispatchers.items():              for key, value in dispatchers.items():
149                  dispatchers[(xmlns, key)] = value                  dispatchers[(xmlns, key)] = value
150    
# Line 545  class SessionLoader(XMLReader): Line 546  class SessionLoader(XMLReader):
546          self.aLayer = self.aMap.LabelLayer()          self.aLayer = self.aMap.LabelLayer()
547    
548      def start_label(self, name, qname, attrs):      def start_label(self, name, qname, attrs):
549          x = float(attrs[(None, 'x')])          attrs = self.check_attrs(name, attrs,
550          y = float(attrs[(None, 'y')])                                   [AttrDesc("x", True, conversion = float),
551          text = self.encode(attrs[(None, 'text')])                                    AttrDesc("y", True, conversion = float),
552          halign = attrs[(None, 'halign')]                                    AttrDesc("text", True),
553          valign = attrs[(None, 'valign')]                                    AttrDesc("halign", True,
554                                               conversion = "ascii"),
555                                      AttrDesc("valign", True,
556                                               conversion = "ascii")])
557            x = attrs['x']
558            y = attrs['y']
559            text = attrs['text']
560            halign = attrs['halign']
561            valign = attrs['valign']
562            if halign not in ("left", "center", "right"):
563                raise LoadError("Unsupported halign value %r" % halign)
564            if valign not in ("top", "center", "bottom"):
565                raise LoadError("Unsupported valign value %r" % valign)
566          self.aLayer.AddLabel(x, y, text, halign = halign, valign = valign)          self.aLayer.AddLabel(x, y, text, halign = halign, valign = valign)
567    
568      def characters(self, chars):      def characters(self, chars):

Legend:
Removed from v.1970  
changed lines
  Added in v.2034

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26