From 0c08d2ee120d382bbd14df227bd76b06c045334d Mon Sep 17 00:00:00 2001 From: CookieDecide Date: Mon, 26 Aug 2024 18:38:01 +0200 Subject: [PATCH] Fixed a geventbug, added log files --- LeagueBuilds_client/src/gui.py | 4 ++-- LeagueBuilds_client/src/lcu.py | 7 ++++--- LeagueBuilds_client/src/main_client.py | 8 ++++++++ LeagueBuilds_client/src/statics.py | 10 +++++----- LeagueBuilds_client/src/web/js/main.js | 4 +++- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/LeagueBuilds_client/src/gui.py b/LeagueBuilds_client/src/gui.py index 6da6b36..94eb4f3 100644 --- a/LeagueBuilds_client/src/gui.py +++ b/LeagueBuilds_client/src/gui.py @@ -517,7 +517,7 @@ def set_position(position): def start(): try: - print("start") + # print("start") eel.start( "index.html", mode="chrome", @@ -530,7 +530,7 @@ def start(): close_callback=close_callback, ) except EnvironmentError: - print("exe") + # print("exe") eel.start( "index.html", mode="default", diff --git a/LeagueBuilds_client/src/lcu.py b/LeagueBuilds_client/src/lcu.py index 2950e77..0fa356c 100644 --- a/LeagueBuilds_client/src/lcu.py +++ b/LeagueBuilds_client/src/lcu.py @@ -10,14 +10,14 @@ def start(): - print("Please start LoL client for LCU API to start.") + # print("Please start LoL client for LCU API to start.") connector.start() @connector.ready async def connect(connection): global old_action, champion - print("LCU API is ready to be used.") + # print("LCU API is ready to be used.") page_session = await connection.request("get", "/lol-champ-select/v1/session") page_session = await page_session.content.read() page_session = json.loads(page_session) @@ -48,7 +48,8 @@ async def connect(connection): @connector.close async def disconnect(_): - print("The client has been closed!") + # print("The client has been closed!") + return @connector.ws.register( diff --git a/LeagueBuilds_client/src/main_client.py b/LeagueBuilds_client/src/main_client.py index 9617b62..632f720 100644 --- a/LeagueBuilds_client/src/main_client.py +++ b/LeagueBuilds_client/src/main_client.py @@ -1,3 +1,11 @@ +import sys, os + +if not os.path.exists("logs"): + os.mkdir("logs") + +sys.stdout = open('logs/output.txt', 'w') +sys.stderr = open('logs/error.txt', 'w') + import lcu, gui, client, version import threading, time import statics diff --git a/LeagueBuilds_client/src/statics.py b/LeagueBuilds_client/src/statics.py index 2d8839e..78c9671 100644 --- a/LeagueBuilds_client/src/statics.py +++ b/LeagueBuilds_client/src/statics.py @@ -52,7 +52,7 @@ def update_summoner(): SUMMONER.insert_many(summoner).on_conflict_replace().execute() - print("Static Summoner") + # print("Static Summoner") def update_maps(): @@ -75,7 +75,7 @@ def update_maps(): MAPS.insert_many(maps).on_conflict_replace().execute() - print("Static Map") + # print("Static Map") def update_runes(): @@ -130,7 +130,7 @@ def update_runes(): RUNESLOTS.insert_many(runeslots).on_conflict_replace().execute() RUNEKEYS.insert_many(runekeys).on_conflict_replace().execute() - print("Static Runes") + # print("Static Runes") def update_items(): @@ -189,7 +189,7 @@ def update_items(): ITEMS.insert_many(items).on_conflict_replace().execute() - print("Static Items") + # print("Static Items") def update_champions(): @@ -266,4 +266,4 @@ def update_champions(): CHAMPIONS.insert_many(champions).on_conflict_replace().execute() - print("Static Champion") + # print("Static Champion") diff --git a/LeagueBuilds_client/src/web/js/main.js b/LeagueBuilds_client/src/web/js/main.js index 6deae4c..038bf7e 100644 --- a/LeagueBuilds_client/src/web/js/main.js +++ b/LeagueBuilds_client/src/web/js/main.js @@ -198,7 +198,9 @@ function reset_position() { img[i].style.background = "var(--color_background)"; } - document.getElementById(role).style.background = "var(--color_hover_background)"; + if (role != "") { + document.getElementById(role).style.background = "var(--color_hover_background)"; + } } function force_position(position) {