From 16a3e5bf9bd04abd64983f0ce92e357f7ad1a1aa Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Wed, 1 Nov 2023 16:36:23 +0100 Subject: [PATCH] Add flask CURA-10561 --- cura/CuraApplication.py | 13 +++++++++++++ requirements.txt | 15 +++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 722a728863f..ab5f237e365 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -129,6 +129,17 @@ numpy.seterr(all = "ignore") +from flask import Flask, request + +app = Flask(__name__) + + +@app.route('/open-model', methods=['GET']) +def open_model(): + Logger.info(f"OPENING MODEL") + model_id = request.args.get('model_id') + Logger.info(f"OPENING MODEL WITH ID {model_id}") + class CuraApplication(QtApplication): # SettingVersion represents the set of settings available in the machine/extruder definitions. # You need to make sure that this version number needs to be increased if there is any non-backwards-compatible @@ -165,6 +176,8 @@ def __init__(self, *args, **kwargs): tray_icon_name = "cura-icon-32.png" if not ApplicationMetadata.IsAlternateVersion else "cura-icon-32_wip.png", **kwargs) + app.run() + self.default_theme = "cura-light" self.change_log_url = "https://ultimaker.com/ultimaker-cura-latest-features?utm_source=cura&utm_medium=software&utm_campaign=cura-update-features" diff --git a/requirements.txt b/requirements.txt index dfa974ef7df..0b5c70d0516 100644 --- a/requirements.txt +++ b/requirements.txt @@ -400,3 +400,18 @@ pywin32-ctypes==0.2.0; \ charset-normalizer==2.1.0; \ --hash=sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5 +Flask==3.0.0 \ + --hash=sha256:21128f47e4e3b9d597a3e8521a329bf56909b690fcc3fa3e477725aa81367638 \ + --hash=sha256:cfadcdb638b609361d29ec22360d6070a77d7463dcb3ab08d2c2f2f168845f58 +itsdangerous==2.1.2 \ + --hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \ + --hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a +blinker==1.6.2 \ + --hash=sha256:4afd3de66ef3a9f8067559fb7a1cbe555c17dcbe15971b05d1b625c3e7abe213 \ + --hash=sha256:c3d739772abb7bc2860abf5f2ec284223d9ad5c76da018234f6f50d6f31ab1f0 +Werkzeug==3.0.0 \ + --hash=sha256:3ffff4dcc32db52ef3cc94dff3000a3c2846890f3a5a51800a27b909c5e770f0 \ + --hash=sha256:cbb2600f7eabe51dbc0502f58be0b3e1b96b893b05695ea2b35b43d4de2d9962 +click==8.1.3 \ + --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \ + --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48