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 |
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 |
|
|
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) |
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 |
|
|