diff options
| author | AAGaming <aagaming@riseup.net> | 2024-05-25 19:14:54 -0400 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2024-05-25 19:14:54 -0400 |
| commit | a84a13c76d99f1e6f4505d43108a4111749e5035 (patch) | |
| tree | e2826700cd371e6590818047551028d8179389bf /backend/decky_loader/plugin | |
| parent | 96cc72f2ca25ccb312b68a29aca755bb7df660ed (diff) | |
| download | decky-loader-a84a13c76d99f1e6f4505d43108a4111749e5035.tar.gz decky-loader-a84a13c76d99f1e6f4505d43108a4111749e5035.zip | |
Custom error handler and some misc fixes
Diffstat (limited to 'backend/decky_loader/plugin')
| -rw-r--r-- | backend/decky_loader/plugin/plugin.py | 8 | ||||
| -rw-r--r-- | backend/decky_loader/plugin/sandboxed_plugin.py | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/backend/decky_loader/plugin/plugin.py b/backend/decky_loader/plugin/plugin.py index 00b5dad8..75e52c6a 100644 --- a/backend/decky_loader/plugin/plugin.py +++ b/backend/decky_loader/plugin/plugin.py @@ -99,8 +99,10 @@ class PluginWrapper: return self def stop(self, uninstall: bool = False): - self._listener_task.cancel() + if hasattr(self, "_listener_task"): + self._listener_task.cancel() async def _(self: PluginWrapper): - await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False)) - await self._socket.close_socket_connection() + if hasattr(self, "_socket"): + await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False)) + await self._socket.close_socket_connection() create_task(_(self))
\ No newline at end of file diff --git a/backend/decky_loader/plugin/sandboxed_plugin.py b/backend/decky_loader/plugin/sandboxed_plugin.py index 0bbcb471..6c2bcee2 100644 --- a/backend/decky_loader/plugin/sandboxed_plugin.py +++ b/backend/decky_loader/plugin/sandboxed_plugin.py @@ -142,7 +142,10 @@ class SandboxedPlugin: try: self.log.info("Attempting to uninstall with plugin " + self.name + "'s \"_uninstall\" function.\n") if hasattr(self.Plugin, "_uninstall"): - await self.Plugin._uninstall(self.Plugin) + if self.api_version > 0: + await self.Plugin._uninstall() + else: + await self.Plugin._uninstall(self.Plugin) self.log.info("Uninstalled " + self.name + "\n") else: self.log.info("Could not find \"_uninstall\" in " + self.name + "'s main.py" + "\n") |
