Add TextSymbolizer.name in python bindings.

Refs #1482.
This commit is contained in:
Hermann Kraus 2012-09-14 01:55:41 +02:00
parent d617403b33
commit f27578d41c

View file

@ -698,6 +698,18 @@ class PythonDatasource(object):
return itertools.imap(make_it, features, itertools.count(1))
class _TextSymbolizer(TextSymbolizer,_injector):
@property
def name(self):
if isinstance(self.properties.format_tree, FormattingText):
return self.properties.format_tree.text
else:
return None # This text symbolizer is using complex formatting features.
# There is no single expression which could be returned as name
@name.setter
def name(self, name):
self.properties.format_tree = FormattingText(name)
@property
def text_size(self):
warnings.warn("'text_size' is deprecated, use format.text_size",