Configtool: let the parsing method decide what a name is.

This is mostly for code robustness.
This commit is contained in:
Markus Hitter 2015-07-15 22:21:10 +02:00
parent e7395c8dd8
commit d9e4cd1086
2 changed files with 10 additions and 3 deletions

View File

@ -291,8 +291,8 @@ class BoardPanel(wx.Panel):
if self.parseCandidateValues(ln): if self.parseCandidateValues(ln):
continue continue
elif ln.lstrip().startswith("#define"): if self.parseDefineName(ln):
self.parseDefineName(ln) continue
# Ignore candidates in the metadata file. # Ignore candidates in the metadata file.
self.candHeatPins = [] self.candHeatPins = []
@ -370,6 +370,9 @@ class BoardPanel(wx.Panel):
t = m.groups() t = m.groups()
if len(t) == 1: if len(t) == 1:
self.cfgNames.append(t[0]) self.cfgNames.append(t[0])
return True
return False
def parseDefineValue(self, ln): def parseDefineValue(self, ln):
m = reDefQS.search(ln) m = reDefQS.search(ln)

View File

@ -242,7 +242,8 @@ class PrinterPanel(wx.Panel):
ln = prevLines + ln ln = prevLines + ln
prevLines = "" prevLines = ""
self.parseDefineName(ln) if self.parseDefineName(ln):
continue
prevLines = "" prevLines = ""
for ln in self.userBuffer: for ln in self.userBuffer:
@ -282,6 +283,9 @@ class PrinterPanel(wx.Panel):
t = m.groups() t = m.groups()
if len(t) == 1: if len(t) == 1:
self.cfgNames.append(t[0]) self.cfgNames.append(t[0])
return True
return False
def parseDefineValue(self, ln): def parseDefineValue(self, ln):
if ln.lstrip().startswith("#define"): if ln.lstrip().startswith("#define"):