From 571e10af9e18f84e68a44434bd1a26d458cf81ba Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 15:25:43 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jupytercad_freecad/handlers.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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)