diff --git a/jupytercad_freecad/handlers.py b/jupytercad_freecad/handlers.py index 3c329bf..771b668 100644 --- a/jupytercad_freecad/handlers.py +++ b/jupytercad_freecad/handlers.py @@ -1,6 +1,5 @@ import json import base64 -import tempfile from pathlib import Path from jupyter_server.base.handlers import APIHandler @@ -9,6 +8,7 @@ from jupytercad_freecad.freecad.loader import FCStd + class BackendCheckHandler(APIHandler): @tornado.web.authenticated def post(self): @@ -26,6 +26,7 @@ def post(self): else: self.finish(json.dumps({"installed": False})) + class JCadExportHandler(APIHandler): @tornado.web.authenticated def post(self): @@ -81,6 +82,14 @@ def setup_handlers(web_app): base_url = web_app.settings["base_url"] - handlers = [(url_path_join(base_url, "jupytercad_freecad", "backend-check"), BackendCheckHandler), - (url_path_join(base_url, "jupytercad_freecad", "export-jcad"), JCadExportHandler)] + handlers = [ + ( + url_path_join(base_url, "jupytercad_freecad", "backend-check"), + BackendCheckHandler, + ), + ( + url_path_join(base_url, "jupytercad_freecad", "export-jcad"), + JCadExportHandler, + ), + ] web_app.add_handlers(host_pattern, handlers)