Robustness for empty databases
This commit is contained in:
parent
c82df8c279
commit
62a06fc188
|
@ -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]
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user