summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarios <marios8543@gmail.com>2022-04-29 12:52:24 +0300
committermarios <marios8543@gmail.com>2022-04-29 12:52:24 +0300
commit7d74e98f4f8a47daac85b5de1ef6aa29a1637c06 (patch)
treea413da14d06f1c1a9cbbe5ae33d7693c640ded5a
parentfe1f6473e9324be5a3ae7bf5c641d1a652c7b5a6 (diff)
downloaddecky-loader-7d74e98f4f8a47daac85b5de1ef6aa29a1637c06.tar.gz
decky-loader-7d74e98f4f8a47daac85b5de1ef6aa29a1637c06.zip
Bug fixes
- Fixed KeyError in execute_in_tab - Changed the plugin process dispatch method, this *should* fix that annoying server hang issue.
-rw-r--r--plugin_loader/main.py10
-rw-r--r--plugin_loader/plugin.py5
-rw-r--r--plugin_loader/utilities.py3
3 files changed, 7 insertions, 11 deletions
diff --git a/plugin_loader/main.py b/plugin_loader/main.py
index 834eb7e3..9ed30760 100644
--- a/plugin_loader/main.py
+++ b/plugin_loader/main.py
@@ -18,7 +18,6 @@ class NoBaseEvents(Filter):
basicConfig(level=CONFIG["log_level"], format="[%(module)s][%(levelname)s]: %(message)s")
for handler in root.handlers:
if not CONFIG["log_base_events"]:
- print("adding filter")
handler.addFilter(NoBaseEvents())
from aiohttp.web import Application, run_app, static
@@ -35,6 +34,7 @@ from utilities import Utilities
from browser import PluginBrowser
logger = getLogger("Main")
+from traceback import print_exc
async def chown_plugin_dir(_):
Popen(["chown", "-R", "deck:deck", CONFIG["plugin_path"]])
@@ -64,11 +64,11 @@ class PluginManager:
async def loader_reinjector(self):
finished_reinjection = False
-
+ logger.info("Plugin loader isn't present in Steam anymore, reinjecting...")
while True:
await sleep(1)
if not await tab_has_element("QuickAccess", "plugin_iframe"):
- logger.info("Plugin loader isn't present in Steam anymore, reinjecting...")
+ logger.debug("Plugin loader isn't present in Steam anymore, reinjecting...")
await self.inject_javascript()
finished_reinjection = True
elif finished_reinjection:
@@ -89,8 +89,8 @@ class PluginManager:
try:
r = dumps(response)
except Exception as e:
- logger.error(e)
- response["result"] = str(response)
+ logger.error(response["result"])
+ response["result"] = str(response["result"])
r = response
await tab._send_devtools_cmd({
"id": 1,
diff --git a/plugin_loader/plugin.py b/plugin_loader/plugin.py
index 0f8880f3..88857797 100644
--- a/plugin_loader/plugin.py
+++ b/plugin_loader/plugin.py
@@ -73,10 +73,7 @@ class PluginWrapper:
def start(self):
if self.passive:
return self
- get_event_loop().run_in_executor(
- ProcessPoolExecutor(),
- self._init
- )
+ ProcessPoolExecutor().submit(self._init, self)
return self
def stop(self):
diff --git a/plugin_loader/utilities.py b/plugin_loader/utilities.py
index fa47da79..39f9ca55 100644
--- a/plugin_loader/utilities.py
+++ b/plugin_loader/utilities.py
@@ -32,7 +32,6 @@ class Utilities:
async def execute_in_tab(self, tab, run_async, code):
try:
result = await inject_to_tab(tab, code, run_async)
-
if "exceptionDetails" in result["result"]:
return {
"success": False,
@@ -41,7 +40,7 @@ class Utilities:
return {
"success": True,
- "result" : result["result"]["result"]["value"]
+ "result" : result["result"]["result"].get("value")
}
except Exception as e:
return {