From 450990624c932dd0e55ed2171b050404e8e41751 Mon Sep 17 00:00:00 2001 From: Protonos Date: Fri, 3 Nov 2023 22:50:07 +0100 Subject: [PATCH] Switched from bottle to werkzeug webserver due to build issues --- main.py | 21 ++++++++++++--------- requirements.txt | Bin 1342 -> 1560 bytes 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 61bb343..170b214 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,8 @@ from PyQt6.QtCore import QTimer, QThread from splash_window import Splash from manager_window import Manager -from bottle import route, run +from werkzeug.serving import run_simple +from werkzeug.wrappers import Request, Response from components.popups import errorDialog,windowsToast from components.tools import writeConfig,readConfig,initConfig @@ -37,18 +38,20 @@ def run(self): # Spotify WatchWitch on new thread (it's helloween) -@route('/watchwitch/spotify/startup') -def index(): - windowsToast("Spicetify Manager", "Spotify just started!") - return 'ok' +@Request.application +def application(request): + if request.path == '/watchwitch/spotify/startup': + windowsToast("Spicetify Manager", "Spotify just started!") + return Response('ok', content_type='text/plain') + return Response('Not Found', status=404, content_type='text/plain') -class BottleThread(QThread): +class WerkzeugThread(QThread): def run(self): print("Server started") - run(host='localhost', port=1738) + run_simple('localhost', 1738, application) -if (readConfig('Manager','watchwitch') == "True"): - watchwitch = BottleThread() +if readConfig('Manager', 'watchwitch') == "True": + watchwitch = WerkzeugThread() watchwitch.start() #start the app if __name__ == "__main__": diff --git a/requirements.txt b/requirements.txt index 1e316495852e982adb2e017ecbea330a04eeb3b5..fe376ae43d47e45078338e8de2dca4a80a6173cc 100644 GIT binary patch delta 214 zcmdnTHG^luBiUqze1;q#E@DVz$OU3sAT(gmV=w_?vx#@5oiiCq7>XHEfKqu3=?tkr zh4~DnKoO8aBcLKfAU0y)W#D4)V#oxl$pWf00?Qi1WG8-36$fbt8G@?OaB?8yPe)S* vU4}rQHKt%~reJL#5@KusLnTyJ7pOavp#ZGP5NbKd2}YZ3nHZT_KyCm4KjtKB delta 23 fcmbQivyW@Sqsc6cVv~~?6DB`k{Ipqt`3n;OY^ezq