Commit 6189dd74 authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

renaming and debugging:

I renamed defineKeywords as declareKeywords better name for what is does.

I also add a debugging alt for the Axes such that if you get

>> "SomeAxes could not be formatted"

you can set debug to True and get the real error message.
parent 1d2a35f5
......@@ -64,7 +64,7 @@ SPCE = " > -----: "
# myFig
D_FIGNUM = 0 # default figure number
D_FIGSIZE = (8., 6.) # default figure size
D_REFORMAT = False # default reformat value
D_REFORMAT = True # default reformat value
D_FORMATTED = False # default formatted value
D_RAWDATA = MyData() # default raw data
D_INPUTARG = 'current' # default Input argument
......
......@@ -156,7 +156,7 @@ class MyFig_base(Figure):
if (self.debug and rest != {}) :
print(DBUG + "These keywords have not been updated: " + str(rest))
return(True)
......@@ -244,7 +244,7 @@ class MyFig(MyFig_base):
# define user keywords before
# __init__ to erase them from kwargs
self.defineKeywords()
self.declareKeywords()
MyFig_base.__init__(self, rawdata, *args, **kwargs)
......@@ -262,8 +262,8 @@ class MyFig(MyFig_base):
# need to be done for the first init
self.set_rawdata(self.rawdata) # This function can be overwriten
# DEFINE KEYWORDS --------------------------------------------------
def defineKeywords(self):
# DECLARE KEYWORDS -------------------------------------------------
def declareKeywords(self):
pass
# ADD AXES ---------------------------------------------------------
......@@ -293,11 +293,14 @@ class MyFig(MyFig_base):
for ax, rawdata in zip(self.get_axes(), self.rawdata):
try:
if(self.debug):
ax.formatRawData(rawdata)
except:
print(SEVR + "The " + str(ax.__class__.__name__) + " with index " + str(self.get_axes().index(ax)) + " could not format the rawdata.")
return(False)
else:
try:
ax.formatRawData(rawdata)
except:
print(SEVR + "The " + str(ax.__class__.__name__) + " with index " + str(self.get_axes().index(ax)) + " could not format the rawdata.")
return(False)
if self.formatted is False:
self.formatted = True
......@@ -334,6 +337,6 @@ class MyFig(MyFig_base):
# RESET ------------------------------------------------------------
def reset(self, *args, **kwargs):
self.clf()
self.defineKeywords()
self.declareKeywords()
self._initialize(*args, **kwargs)
self.plot()
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