Little CleanUp

This commit is contained in:
Sagi Frimer
2019-03-02 00:12:41 +02:00
parent 05305393a9
commit dac1fa3677
3 changed files with 8 additions and 8 deletions

View File

@@ -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}")

View File

@@ -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")
)

View File

@@ -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")