From b90c85f56e935d0249d7e3b6c0071e00235086dc Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 23 Nov 2021 12:30:49 +0100 Subject: [PATCH] sorted filenames --- webserver.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webserver.py b/webserver.py index 8a43ea5..991ced9 100644 --- a/webserver.py +++ b/webserver.py @@ -36,7 +36,7 @@ class WebSocketHandler(tornado.websocket.WebSocketHandler): """ Websocket from the workers """ - CORS_ORIGINS = ['localhost'] + # CORS_ORIGINS = ['localhost'] connections = set() def initialize(self, config): @@ -45,11 +45,11 @@ class WebSocketHandler(tornado.websocket.WebSocketHandler): self.hasWritten = False self.dimensions = [None, None] - def check_origin(self, origin): - parsed_origin = urlparse(origin) - # parsed_origin.netloc.lower() gives localhost:3333 - valid = any([parsed_origin.hostname.endswith(origin) for origin in self.CORS_ORIGINS]) - return valid + # def check_origin(self, origin): + # parsed_origin = urlparse(origin) + # # parsed_origin.netloc.lower() gives localhost:3333 + # valid = any([parsed_origin.hostname.endswith(origin) for origin in self.CORS_ORIGINS]) + # return valid # the client connected def open(self, p = None): @@ -127,7 +127,7 @@ class AnimationHandler(tornado.web.RequestHandler): self.set_header("Content-Type", "application/json") # filename = self.get_argument("file", None) if filename == '': - names = [f"/files/{name[:-4]}" for name in os.listdir(self.config.storage) if name not in ['.gitignore']] + names = sorted([f"/files/{name[:-4]}" for name in os.listdir(self.config.storage) if name not in ['.gitignore']]) self.write(json.dumps(names)) else: path = os.path.join(self.config.storage,os.path.basename(filename)+".csv")