Browse Source

clears screen and removed format strings

no_compress
Raphael Roberts 7 years ago
parent
commit
6a3bbcde8e
  1. 8
      main.py

8
main.py

@ -36,15 +36,15 @@ def pprint_delta(delta):
hour,minute,second = map(int,time.split(':')) hour,minute,second = map(int,time.split(':'))
time = '' time = ''
if hour: if hour:
time += f'{hour} hour' + ('s' if hour != 1 else '')
time += '{hour} hour'.format(hour=hour) + ('s' if hour != 1 else '')
if minute: if minute:
if time and not time.endswith(', '): if time and not time.endswith(', '):
time += ', ' time += ', '
time += f'{minute} minute' + ('s' if minute != 1 else '')
time += '{minute} minute'.format(minute=minute) + ('s' if minute != 1 else '')
if second: if second:
if time and not time.endswith(', '): if time and not time.endswith(', '):
time += ', ' time += ', '
time += f'{second} second' + ('s' if second != 1 else '')
time += '{second} second'.format(second=second) + ('s' if second != 1 else '')
ret = '' ret = ''
if days: if days:
ret = days + ', ' if time else '' ret = days + ', ' if time else ''
@ -163,7 +163,7 @@ if __name__ == '__main__':
_done = False _done = False
while not _done: while not _done:
try: try:
show(data,args.route,False)
show(data,args.route,True)
s = time.perf_counter() s = time.perf_counter()
data = ctabus.get_times(stop_id) data = ctabus.get_times(stop_id)
e = time.perf_counter() - s e = time.perf_counter() - s

Loading…
Cancel
Save