diff options
| author | marios <marios8543@gmail.com> | 2022-05-26 04:00:18 +0300 |
|---|---|---|
| committer | marios <marios8543@gmail.com> | 2022-05-26 04:00:18 +0300 |
| commit | 4b923c1dc70eaa4a3ca58d9e9f3218785b2fe919 (patch) | |
| tree | 3394a7e752b61bdfa16b1a7f50842c4e1dbc0972 /backend/plugin.py | |
| parent | 74438a31458af8bddd08d90eacc6d63677bab844 (diff) | |
| download | decky-loader-4b923c1dc70eaa4a3ca58d9e9f3218785b2fe919.tar.gz decky-loader-4b923c1dc70eaa4a3ca58d9e9f3218785b2fe919.zip | |
display overhaul, compatibility with legacy plugins, fixes
Diffstat (limited to 'backend/plugin.py')
| -rw-r--r-- | backend/plugin.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/backend/plugin.py b/backend/plugin.py index db335225..502b35bf 100644 --- a/backend/plugin.py +++ b/backend/plugin.py @@ -10,9 +10,6 @@ from signal import SIGINT, signal from sys import exit from time import time -from injector import inject_to_tab - - class PluginWrapper: def __init__(self, file, plugin_directory, plugin_path) -> None: self.file = file @@ -24,13 +21,23 @@ class PluginWrapper: json = load(open(path.join(plugin_path, plugin_directory, "plugin.json"), "r")) + if "frontend_bundle" in json: + self.frontend_bundle = json["frontend_bundle"] + self.legacy = False + else: + self.main_view_html = json["main_view_html"] + self.tile_view_html = json["tile_view_html"] if "tile_view_html" in json else "" + self.legacy = True + self.name = json["name"] self.author = json["author"] - self.frontend_bundle = json["frontend_bundle"] self.flags = json["flags"] self.passive = not path.isfile(self.file) + def __str__(self) -> str: + return self.name + def _init(self): signal(SIGINT, lambda s, f: exit(0)) |
