mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Little CleanUp
This commit is contained in:
@@ -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}")
|
||||
|
||||
@@ -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")
|
||||
)
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user