Compare commits

...

3 Commits

Author SHA1 Message Date
TrainDoctor 3a927084b0 FIlled out functionality of handler function, now for JS to call route 2022-12-10 14:25:21 -08:00
TrainDoctor 5e07c8f028 Fix a typo 2022-12-10 14:25:20 -08:00
TrainDoctor 91d1bc8a78 Improvements to install of remote binaries, and start backend reloading 2022-12-10 14:25:20 -08:00
3 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ Please consult [the wiki page regarding development](https://deckbrew.xyz/en/loa
1. Use the VS Code tasks or `deck.sh` script to deploy your changes to your Steam Deck to test them.
1. You will be testing your changes with the Python script version. You will need to build, deploy, and reload each time.
⚠️ If you are recieving build errors due to an out of date library, you should run this command inside of your repository.
⚠️ If you are receiving build errors due to an out of date library, you should run this command inside of your repository.
```bash
pnpm update decky-frontend-lib --latest
+7
View File
@@ -60,6 +60,9 @@ class PluginBrowser:
if "remote_binary" in packageJson and len(packageJson["remote_binary"]) > 0:
# create bin directory if needed.
rc=call(["chmod", "-R", "777", pluginBasePath])
if rc != 0:
logger.error(f"chown of plugin w/ remote binary exited with a non-zero exit code, chmod: {rc})")
if access(pluginBasePath, W_OK):
if not path.exists(pluginBinPath):
@@ -67,6 +70,8 @@ class PluginBrowser:
if not access(pluginBinPath, W_OK):
rc=call(["chmod", "-R", "777", pluginBinPath])
if rc != 0:
logger.error(f"chown of plugin w/ remote binary exited with a non-zero exit code, chmod: {rc})")
rv = True
for remoteBinary in packageJson["remote_binary"]:
@@ -80,6 +85,8 @@ class PluginBrowser:
code_chown = call(["chown", "-R", get_user()+":"+get_user_group(), self.plugin_path])
rc=call(["chmod", "-R", "555", pluginBasePath])
if code_chown or rc != 0:
logger.error(f"chown/chmod exited with a non-zero exit code (chown: {code_chown}, chmod: {rc})")
else:
rv = True
logger.debug(f"No Remote Binaries to Download")
+13 -1
View File
@@ -7,7 +7,7 @@ if hasattr(sys, '_MEIPASS'):
from asyncio import new_event_loop, set_event_loop, sleep
from json import dumps, loads
from logging import DEBUG, INFO, basicConfig, getLogger
from os import getenv, chmod, path
from os import getenv, chmod, listdir, path
from traceback import format_exc
import aiohttp_cors
@@ -91,6 +91,7 @@ class PluginManager:
chown_plugin_dir()
self.loop.create_task(self.loader_reinjector())
self.loop.create_task(self.load_plugins())
self.loop.create_task(self.reload_plugin_backends())
self.web_app.on_startup.append(startup)
@@ -116,6 +117,17 @@ class PluginManager:
self.plugin_loader.import_plugins()
# await inject_to_tab("SP", "window.syncDeckyPlugins();")
async def reload_plugin_backends(self, name):
await self.wait_for_server()
if name in self.plugin_loader.plugins:
self.plugin_loader.plugins[name].stop()
self.plugin_loader.plugins.pop(name, None)
else:
logger.error("Couldn't find plugin %s to reload.", str(name))
directories = [i for i in listdir(self.plugin_loader.plugin_path) if path.isdir(path.join(self.plugin_loader.plugin_path, i)) and path.isfile(path.join(self.plugin_loader.plugin_path, i, "plugin.json"))]
if name in directories:
Loader.import_plugin(path.join(self.plugin_loader.plugin_path, directories[name], "main.py"), directories[name], False, False)
async def loader_reinjector(self):
while True:
tab = None