win .exe fixes …

This commit is contained in:
alterNERDtive 2019-10-14 17:27:24 +02:00
parent 6dc1a02691
commit b3f70aa8a9

View file

@ -58,7 +58,7 @@ def outputGui():
lbl.grid(row=row, column=0) lbl.grid(row=row, column=0)
lbl = tk.Label(frame, text='{}ly'.format(distances[cmdr])) lbl = tk.Label(frame, text='{}ly'.format(distances[cmdr]))
lbl.grid(row=row, column=1) lbl.grid(row=row, column=1)
except (ServerError, NotFoundError) as e: except (ServerError, SystemNotFoundError) as e:
lbl = tk.Label(frame, text=e) lbl = tk.Label(frame, text=e)
lbl.grid(row=0, columnspan=2) lbl.grid(row=0, columnspan=2)
except EdsmApiException as e: except EdsmApiException as e:
@ -88,13 +88,13 @@ def outputText():
distances = getDistances(system, cmdrs) distances = getDistances(system, cmdrs)
except ServerError as e: except ServerError as e:
print(e) print(e)
exit(1) sys.exit(1)
except SystemNotFoundError as e: except SystemNotFoundError as e:
print(e) print(e)
exit(2) sys.exit(2)
except EdsmApiException as e: except EdsmApiException as e:
print(e) print(e)
exit(1) sys.exit(1)
nearestCmdr = min(distances,key=distances.get) nearestCmdr = min(distances,key=distances.get)
if shortOutput: if shortOutput:
print('nearest commander: {} ({} ly).'.format(nearestCmdr, print('nearest commander: {} ({} ly).'.format(nearestCmdr,
@ -105,6 +105,7 @@ def outputText():
print() print()
for cmdr in distances: for cmdr in distances:
print('{}: {} ly'.format(cmdr, distances[cmdr])) print('{}: {} ly'.format(cmdr, distances[cmdr]))
sys.exit(0)
# ================================================================================= # =================================================================================