Commit 1952e31f authored by Philipp Gast's avatar Philipp Gast
Browse files

now it is nice... hopfully

parent d694ec69
......@@ -124,26 +124,32 @@ class MyFig(Figure):
# UPDATE ----------------------------------------------------------
def update(self, **kwargs):
# check attributes in keywords
for keyword in kwargs.keys():
# if it is the rawdata use the function
if keyword == 'rawdata':
self.set_rawdata(kwargs['rawdata'])
# if it is an attribute
elif keyword in self._attributesToUpdateKeys:
# update value
setattr(self, keyword, kwargs[keyword])
# For each axes update the keywords
for ax in self.get_axes():
forax={}
# check attributes in keywords
for keyword in kwargs.keys():
# if it is the rawdata use the function
if keyword == 'rawdata':
self.set_rawdata(kwargs['rawdata'])
# if it is an attribute
elif keyword in self._attributesToUpdateKeys:
# update value
setattr(self, keyword, kwargs[keyword])
if keyword in ['rawdata'] + self._attributesToUpdateKeys :
pass
# Check if a key of kwargs has an alias for this axes
elif keyword in self.aliases.keys():
alax, alkey = self.aliases[keyword]
# If an alias is found then update axkwargs
if ax == alax:
forax.update(**{alkey: kwargs[keyword]})
......@@ -154,7 +160,10 @@ class MyFig(Figure):
forax.update(**{keyword : kwargs[keyword]})
# Then eventually all collected Keywords are updated in one go
ax.update(**forax)
if (forax) :
if self.debug:
print (DBUG+' fig.update ', ax, 'keywords: ', forax)
ax.update(**forax)
return(True)
......
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