Commit fb67c64e authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

Merge branch 'move-keywords' of into myTool-update

parents aae819e0 6808891d
......@@ -100,3 +100,11 @@ class MyAxes(Axes):
# TESTING THE RAWDATA ------------------------------------------------
def testRawData(self, rawdata):
# UPDATE -------------------------------------------------------------
def update(self, **kwargs):
for key in kwargs.keys():
if key in self.keywords.keys():
self.keywords[key] = kwargs[key]
......@@ -138,33 +138,27 @@ class MyFig(Figure):
# update value
setattr(self, keyword, kwargs[keyword])
del rest[keyword]
# For each axes update the keywords
for ax in self.get_axes():
# if aliases is defined with that name
elif keyword in self.aliases.keys():
# update
ax, key = self.aliases[keyword]
ax.keywords[key] = kwargs[keyword]
del rest[keyword]
axrest = rest.copy() # make a copy of rest for this axes
# either a keywords or crap
# if it is an axes keyword
for ax in self.get_axes() :
# Check if a key of rest has an alias for this axes
for krest in rest.keys():
if krest in self.aliases.keys():
alax, alkey = self.aliases[krest]
if keyword in ax.keywords.keys():
ax.keywords.update({keyword: kwargs[keyword]})
delete = True
if delete:
del rest[keyword]
# if there were some crap
if (self.debug and rest != {}) :
print(DBUG + "These keywords have not been updated: " + str(rest))
# If an alias is found then update the rest
if ax == alax:
axrest.update({alkey: rest[krest]})
# When eventual alias are added then update
# DECLARE ALIASES -------------------------------------------------
def declareAliases(self):
self.aliases = {}
Supports Markdown
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