Configtool: record False boolean #defines, too.

This will be helpful for handling sets of booleans better.
This commit is contained in:
Markus Hitter 2016-04-18 16:57:29 +02:00
parent bdacd8c9bc
commit a95a1c8855
2 changed files with 14 additions and 8 deletions

View File

@ -332,8 +332,8 @@ class BoardPanel(wx.Panel):
#print self.candProcessors
#print self.candClocks
#print self.tempTables
#print self.cfgValues # #defines with a value and enabled booleans.
#print self.cfgNames # Names only, but also of disabled booleans.
#print self.cfgValues # #defines with a value and booleans.
#print self.cfgNames # Names found in the generic file.
#print self.helpText
for k in range(len(self.sensors)):
@ -401,11 +401,14 @@ class BoardPanel(wx.Panel):
self.cfgValues[t[0]] = t[1], False
return True
m = reDefBoolBL.search(ln)
m = reDefBool.search(ln)
if m:
t = m.groups()
if len(t) == 1 and (t[0] in self.cfgNames):
self.cfgValues[t[0]] = True
if reDefBoolBL.search(ln):
self.cfgValues[t[0]] = True
else:
self.cfgValues[t[0]] = False
return True
return False

View File

@ -258,8 +258,8 @@ class PrinterPanel(wx.Panel):
# Parsing done. All parsed stuff is now in these arrays and dicts.
# Uncomment for debugging.
#print self.cfgValues # #defines with a value and enabled booleans.
#print self.cfgNames # Names only, but also of disabled booleans.
#print self.cfgValues # #defines with a value and booleans.
#print self.cfgNames # Names found in the generic file.
#print self.helpText
if os.path.basename(fn) in protectedFiles:
@ -318,11 +318,14 @@ class PrinterPanel(wx.Panel):
self.cfgValues[t[0]] = t[1], False
return True
m = reDefBoolBL.search(ln)
m = reDefBool.search(ln)
if m:
t = m.groups()
if len(t) == 1 and (t[0] in self.cfgNames):
self.cfgValues[t[0]] = True
if reDefBoolBL.search(ln):
self.cfgValues[t[0]] = True
else:
self.cfgValues[t[0]] = False
return True
return False