close spinner when manager fails to start

pull/2637/head
Adeeb Shihadeh 5 years ago
parent db0d4cdd86
commit 631059d931
  1. 6
      selfdrive/manager.py

@ -107,8 +107,7 @@ if not prebuilt:
prefix = b'progress: ' prefix = b'progress: '
if line.startswith(prefix): if line.startswith(prefix):
i = int(line[len(prefix):]) i = int(line[len(prefix):])
if spinner is not None: spinner.update("%d" % (70.0 * (i / TOTAL_SCONS_NODES)))
spinner.update("%d" % (70.0 * (i / TOTAL_SCONS_NODES)))
elif len(line): elif len(line):
compile_output.append(line) compile_output.append(line)
print(line.decode('utf8', 'replace')) print(line.decode('utf8', 'replace'))
@ -141,10 +140,10 @@ if not prebuilt:
cloudlog.error("scons build failed\n" + error_s) cloudlog.error("scons build failed\n" + error_s)
# Show TextWindow # Show TextWindow
spinner.close()
error_s = "\n \n".join(["\n".join(textwrap.wrap(e, 65)) for e in errors]) error_s = "\n \n".join(["\n".join(textwrap.wrap(e, 65)) for e in errors])
with TextWindow("openpilot failed to build\n \n" + error_s) as t: with TextWindow("openpilot failed to build\n \n" + error_s) as t:
t.wait_for_exit() t.wait_for_exit()
exit(1) exit(1)
else: else:
break break
@ -609,6 +608,7 @@ if __name__ == "__main__":
# Show last 3 lines of traceback # Show last 3 lines of traceback
error = traceback.format_exc(-3) error = traceback.format_exc(-3)
error = "Manager failed to start\n \n" + error error = "Manager failed to start\n \n" + error
spinner.close()
with TextWindow(error) as t: with TextWindow(error) as t:
t.wait_for_exit() t.wait_for_exit()

Loading…
Cancel
Save