Commit 88d717e0 authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Improved to_dict method of BasemapStyle to discard property methods.

git-svn-id: https://svn.seismo.oma.be/svn/seismo/mapping/layeredbasemap/trunk@7645 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent 33d21034
......@@ -40,7 +40,10 @@ class BasemapStyle(object):
"""
d = {}
for attr in dir(self):
if attr == "text_filter" or (not attr.startswith('__') and not callable(getattr(self, attr))):
## Discard methods and property methods
if (attr == "text_filter"
or (not attr.startswith('__') and not callable(getattr(self, attr))
and not isinstance(getattr(self.__class__, attr, None), property))):
d[attr] = getattr(self, attr, None)
return d
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment