diff --git a/Python/Main.py b/Python/Main.py index b328af8de..e22b243e6 100644 --- a/Python/Main.py +++ b/Python/Main.py @@ -1,11 +1,9 @@ -# import WebSiteHandler import tornado.ioloop from app.Chameleon_Vision_App import ChameleonApplication from tornado.options import options if __name__ == "__main__": - # WebSiteHandler.run_all() tornado.options.parse_command_line() app = ChameleonApplication() print(f"Serving on port {options.port}") diff --git a/Python/app/Chameleon_Vision_App.py b/Python/app/Chameleon_Vision_App.py index 98091aea4..20f60cc36 100644 --- a/Python/app/Chameleon_Vision_App.py +++ b/Python/app/Chameleon_Vision_App.py @@ -14,8 +14,8 @@ class ChameleonApplication(tornado.web.Application): handlers = [(r"/", MainHandler), (r"/websocket", ChameleonWebSocket), (r"/CSS/(.*)", tornado.web.StaticFileHandler, {'path': os.path.join(os.path.dirname(__file__), "../../Site/CSS")}), - (r"/JS/(.*)", tornado.web.StaticFileHandler, - {'path': os.path.join(os.path.dirname(__file__), "../../Site/JS")})] + (r"/JS/(.*)", tornado.web.StaticFileHandler, {'path': os.path.join(os.path.dirname(__file__), "../../Site/JS")})] + settings = dict( template_path=os.path.join(os.path.dirname(__file__), "../../Site") ) diff --git a/Python/app/handlers/SocketHandler.py b/Python/app/handlers/SocketHandler.py index a2e7a84f9..1098faef6 100644 --- a/Python/app/handlers/SocketHandler.py +++ b/Python/app/handlers/SocketHandler.py @@ -1,12 +1,14 @@ import tornado.websocket + class ChameleonWebSocket(tornado.websocket.WebSocketHandler): def open(self): - print("WebSocke opend") + print("WebSocket opened") def on_message(self, message): print(message) - self.write_message("why the fuck did you send a messege") - def on_close(self): - print("websocket closed") + self.write_message("why the fuck did you send a message") + + def on_close(self): + print("WebSocket closed")