Commit 6ad02f23 authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

Now declare aliases is working

parent 9c52f8b3
......@@ -27,6 +27,13 @@ frame = [0.2, 0.15, 0.6, 0.7]
self.add_axes(AxDesign(self, ratio, frame, design=myAxesDesign), 'ax1')
'''
DEFAULT_DECLARE_ALIASES = '''
self.aliases = {}
'''
_DEFAULT_FIG_DESIGN = {'declareAliases': DEFAULT_DECLARE_ALIASES,
'addAxes': DEFAULT_ADDAXES}
class MyDesign(dict):
......@@ -48,9 +55,21 @@ class FigDesign(MyFig):
MyFig.__init__(self, rawdata, *args, **kwargs)
def declareAliases(self):
print('DECLARE ALIASES')
figDesign = self.design.get(self.design.figClassName, _DEFAULT_FIG_DESIGN)
if 'declareAliases' in figDesign:
exec(''.join(str(figDesign['declareAliases'])))
else:
print('DECLARE ALIASES NOT DONE')
pass
def addAxes(self):
figDesign = self.design.get(self.design.figClassName, DEFAULT_ADDAXES)
figDesign = self.design.get(self.design.figClassName, _DEFAULT_FIG_DESIGN)
if 'addAxes' in figDesign:
exec(''.join(str(figDesign['addAxes'])))
......
......@@ -24,7 +24,5 @@ class QMyDesignTabs(QTabWidget):
plotDesign.axesClassName.append(self.axesTab.getClassName())
plotDesign.update({plotDesign.figClassName: self.figTab.getFigFunctions(),
plotDesign.axesClassName[0]: self.axesTab.getAxesFunctions()})
print('qMyDesignTab: PlotDesign: ' +str(plotDesign))
return(plotDesign)
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