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 |
|
"http://thuban.intevation.org/dtds/thuban-1.0.0.dtd"): |
149 |
for key, value in dispatchers.items(): |
for key, value in dispatchers.items(): |
150 |
dispatchers[(xmlns, key)] = value |
dispatchers[(xmlns, key)] = value |
151 |
|
|
547 |
self.aLayer = self.aMap.LabelLayer() |
self.aLayer = self.aMap.LabelLayer() |
548 |
|
|
549 |
def start_label(self, name, qname, attrs): |
def start_label(self, name, qname, attrs): |
550 |
x = float(attrs[(None, 'x')]) |
attrs = self.check_attrs(name, attrs, |
551 |
y = float(attrs[(None, 'y')]) |
[AttrDesc("x", True, conversion = float), |
552 |
text = self.encode(attrs[(None, 'text')]) |
AttrDesc("y", True, conversion = float), |
553 |
halign = attrs[(None, 'halign')] |
AttrDesc("text", True), |
554 |
valign = attrs[(None, 'valign')] |
AttrDesc("halign", True, |
555 |
|
conversion = "ascii"), |
556 |
|
AttrDesc("valign", True, |
557 |
|
conversion = "ascii")]) |
558 |
|
x = attrs['x'] |
559 |
|
y = attrs['y'] |
560 |
|
text = attrs['text'] |
561 |
|
halign = attrs['halign'] |
562 |
|
valign = attrs['valign'] |
563 |
|
if halign not in ("left", "center", "right"): |
564 |
|
raise LoadError("Unsupported halign value %r" % halign) |
565 |
|
if valign not in ("top", "center", "bottom"): |
566 |
|
raise LoadError("Unsupported valign value %r" % valign) |
567 |
self.aLayer.AddLabel(x, y, text, halign = halign, valign = valign) |
self.aLayer.AddLabel(x, y, text, halign = halign, valign = valign) |
568 |
|
|
569 |
def characters(self, chars): |
def characters(self, chars): |