fixed bug (crash) in case (meaningless) strings found after part or section key.

DAMASK itself is fine with it, and it can be used for commenting.
thanks to B. Bode for figuring out
This commit is contained in:
Martin Diehl 2015-03-27 16:23:21 +00:00
parent 8a30021202
commit 151d4ff75b
1 changed files with 2 additions and 2 deletions

View File

@ -151,12 +151,12 @@ class Material():
line = line.split('/echo/')[0].strip() # remove '/echo/' tags
line = line.lower() # be case insensitive
if line: # content survives...
match_part = re_part.match(line)
match_part = re_part.match(line.split()[0])
if match_part: # found <part> separator
active = (match_part.group(1) == part) # only active in <part>
continue
if active:
match_sec = re_sec.match(line)
match_sec = re_sec.match(line.split()[0])
if match_sec: # found [section]
name_section = match_sec.group(1) # remember name ...
if '__order__' not in self.data[part]: self.data[part]['__order__'] = []