ignore empty lines, ignore missing files
This commit is contained in:
parent
f9716f9e9f
commit
9b1ef1a655
@ -48,9 +48,15 @@ def SameScore(a, b):
|
|||||||
|
|
||||||
def LoadRecordsFromFile(path):
|
def LoadRecordsFromFile(path):
|
||||||
records = []
|
records = []
|
||||||
with open(path, "r") as f:
|
try:
|
||||||
for line in f.readlines():
|
with open(path, "r") as f:
|
||||||
records.append(ParseScore(line.strip()))
|
for line in f.readlines():
|
||||||
|
line = line.strip()
|
||||||
|
if line != "":
|
||||||
|
records.append(ParseScore(line))
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
return records
|
return records
|
||||||
|
|
||||||
def AddScore(records, score):
|
def AddScore(records, score):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user