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]> |
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: |
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: |
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: |