1
0

Robustness for empty databases
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 25s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 22s

This commit is contained in:
Jon Michael Aanes 2025-01-22 21:20:16 +01:00
parent c82df8c279
commit 62a06fc188
2 changed files with 8 additions and 2 deletions

View File

@ -18,8 +18,11 @@ FILEPATH = 'output/entries_db.txt'
def get_tracking_numbers() -> list[TrackingNumberEntry]:
try:
with open(FILEPATH) as f:
lines = f.read().split('\n')
except FileNotFoundError:
lines = ''
lines = [line.split(' ') for line in lines if len(line) > 0]
return [TrackingNumberEntry(line[0], ' '.join(line[1:])) for line in lines]

View File

@ -106,6 +106,9 @@ footer {
</div>
</a>
% end
% if len(tracking_results) == 0:
<div style="text-align: center"><b>No Parcels yet...<br>Add some below!</b></div>
% end
</div>
</main>