mirror of
https://jihulab.com/mr-one/openpilot.git
synced 2026-10-26 20:43:49 +08:00
dashcam: add main() entrypoint so manager can launch it (mod.main())
This commit is contained in:
+6
-2
@@ -387,10 +387,14 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self.send_error(404, "Not found")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
srv = ThreadingHTTPServer(("0.0.0.0", PORT), Handler)
|
||||
print("Dashcam viewer: http://0.0.0.0:%d/ realdata=%s" % (PORT, REALDATA_DIR))
|
||||
print("Dashcam viewer: http://0.0.0.0:%d/ realdata=%s" % (PORT, REALDATA_DIR), flush=True)
|
||||
try:
|
||||
srv.serve_forever()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user