Add additional line breaks to data file

This commit is contained in:
mmcwilliams 2023-11-29 12:55:14 -05:00
parent cabd7f3415
commit 2e0bfecdcd
1 changed files with 6 additions and 0 deletions

View File

@ -43,18 +43,24 @@ with open(filePath, 'r') as file:
lines = file.readlines() lines = file.readlines()
for line in lines: for line in lines:
if 'train: ' in line: if 'train: ' in line:
data.append(f'{os.linesep}')
data.append(f'train: {trainPath}{os.linesep}') data.append(f'train: {trainPath}{os.linesep}')
elif 'val: ' in line: elif 'val: ' in line:
data.append(f'{os.linesep}')
data.append(f'val: {validPath}{os.linesep}') data.append(f'val: {validPath}{os.linesep}')
elif 'test: ' in line: elif 'test: ' in line:
data.append(f'{os.linesep}')
data.append(f'test: {testPath}{os.linesep}') data.append(f'test: {testPath}{os.linesep}')
else: else:
data.append(line) data.append(line)
if not isInList('train: ', data): if not isInList('train: ', data):
data.append(f'{os.linesep}')
data.append(f'train: {trainPath}{os.linesep}') data.append(f'train: {trainPath}{os.linesep}')
elif not isInList('val: ', data): elif not isInList('val: ', data):
data.append(f'{os.linesep}')
data.append(f'val: {validPath}{os.linesep}') data.append(f'val: {validPath}{os.linesep}')
elif not isInList('test: ', data): elif not isInList('test: ', data):
data.append(f'{os.linesep}')
data.append(f'test: {testPath}{os.linesep}') data.append(f'test: {testPath}{os.linesep}')
file.close() file.close()