Add additional line breaks to data file
This commit is contained in:
parent
cabd7f3415
commit
2e0bfecdcd
|
@ -43,18 +43,24 @@ with open(filePath, 'r') as file:
|
|||
lines = file.readlines()
|
||||
for line in lines:
|
||||
if 'train: ' in line:
|
||||
data.append(f'{os.linesep}')
|
||||
data.append(f'train: {trainPath}{os.linesep}')
|
||||
elif 'val: ' in line:
|
||||
data.append(f'{os.linesep}')
|
||||
data.append(f'val: {validPath}{os.linesep}')
|
||||
elif 'test: ' in line:
|
||||
data.append(f'{os.linesep}')
|
||||
data.append(f'test: {testPath}{os.linesep}')
|
||||
else:
|
||||
data.append(line)
|
||||
if not isInList('train: ', data):
|
||||
data.append(f'{os.linesep}')
|
||||
data.append(f'train: {trainPath}{os.linesep}')
|
||||
elif not isInList('val: ', data):
|
||||
data.append(f'{os.linesep}')
|
||||
data.append(f'val: {validPath}{os.linesep}')
|
||||
elif not isInList('test: ', data):
|
||||
data.append(f'{os.linesep}')
|
||||
data.append(f'test: {testPath}{os.linesep}')
|
||||
file.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue