1
0
mirror of synced 2024-11-27 22:40:49 +01:00

parsers.py: Add support for multi-value SCOREINIT/SCOREDIFF

Fixes #34.
This commit is contained in:
Viv 2023-07-15 12:02:50 -04:00
parent fbe2fe21cc
commit b5abb8d4b9

View File

@ -56,10 +56,11 @@ def getCourseData(lines):
raise ValueError()
elif nameUpper == 'LEVEL':
parsedTJA.courses[currentCourse].level = int(value) if value else 0
# NB: If there are multiple SCOREINIT/SCOREDIFF values, use the last one (shinuti)
elif nameUpper == 'SCOREINIT':
parsedTJA.courses[currentCourse].scoreInit = int(value) if value else 0
parsedTJA.courses[currentCourse].scoreInit = int(value.split(",")[-1]) if value else 0
elif nameUpper == 'SCOREDIFF':
parsedTJA.courses[currentCourse].scoreDiff = int(value) if value else 0
parsedTJA.courses[currentCourse].scoreDiff = int(value.split(",")[-1]) if value else 0
elif nameUpper == 'BALLOON':
if value:
balloons = [int(v) for v in value.split(",") if v]