Configtool: attempt to fix broken pin definitions.

We can't magically find out what the right pin is, but we can at
least make sure it gets written with valid syntax next time. This
also ensures pins can be handled in the GUI, avoiding failures
like the one reported by inline comments here:

b9fe0a5dd0
This commit is contained in:
Markus Hitter 2016-06-01 13:13:22 +02:00
parent d9cf035687
commit 09bcb0cf42
1 changed files with 11 additions and 4 deletions

View File

@ -267,11 +267,18 @@ class Page:
print "Key " + k + " not found in config data."
for k in self.choices.keys():
if k in cfgValues.keys():
self.choicesOriginal[k] = cfgValues[k]
self.setChoice(k, cfgValues, "-")
else:
if k not in cfgValues.keys():
print "Key " + k + " not found in config data."
# Fix this.
cfgValues[k] = ("xxxx", False)
# Fix existing #define, but missing value.
if isinstance(cfgValues[k], bool):
print("Fixing %s from boolean to pin with value." % k);
cfgValues[k] = ("xxxx", False)
self.choicesOriginal[k] = cfgValues[k]
self.setChoice(k, cfgValues, "-")
for k in self.boolChoices.keys():
choice = self.boolChoices[k]