close spinner when manager fails to start

old-commit-hash: 631059d9317c062e94376f721e10f33d70983aaa
This commit is contained in:
Adeeb Shihadeh
2020-11-26 16:25:44 -08:00
parent 0c87036b54
commit b882046c76
+3 -3
View File
@@ -107,8 +107,7 @@ if not prebuilt:
prefix = b'progress: '
if line.startswith(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):
compile_output.append(line)
print(line.decode('utf8', 'replace'))
@@ -141,10 +140,10 @@ if not prebuilt:
cloudlog.error("scons build failed\n" + error_s)
# Show TextWindow
spinner.close()
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:
t.wait_for_exit()
exit(1)
else:
break
@@ -609,6 +608,7 @@ if __name__ == "__main__":
# Show last 3 lines of traceback
error = traceback.format_exc(-3)
error = "Manager failed to start\n \n" + error
spinner.close()
with TextWindow(error) as t:
t.wait_for_exit()