diff options
| author | Jonas Dellinger <jonas.dellinger@2trde.com> | 2022-06-16 18:33:43 +0200 |
|---|---|---|
| committer | Jonas Dellinger <jonas.dellinger@2trde.com> | 2022-06-16 18:33:43 +0200 |
| commit | 0a12fe6102da33977548ba0c277bd4fe34e262ab (patch) | |
| tree | 7ff803d0d106db43ce206a6cdfc74c187f0d901a /backend/plugin/plugin.py | |
| parent | a95bf94d878f61869895bb22cbff1b4f524c5dca (diff) | |
| download | decky-loader-0a12fe6102da33977548ba0c277bd4fe34e262ab.tar.gz decky-loader-0a12fe6102da33977548ba0c277bd4fe34e262ab.zip | |
First draft of backend independent plugins
Diffstat (limited to 'backend/plugin/plugin.py')
| -rw-r--r-- | backend/plugin/plugin.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/backend/plugin/plugin.py b/backend/plugin/plugin.py new file mode 100644 index 00000000..3e359ea7 --- /dev/null +++ b/backend/plugin/plugin.py @@ -0,0 +1,18 @@ +from posixpath import join + +from genericpath import isfile + +from plugin.binary_plugin import BinaryPlugin +from plugin.passive_plugin import PassivePlugin +from plugin.python_plugin import PythonPlugin + + +def get_plugin_backend(spec, plugin_directory, flags, logger): + if spec == None and isfile(join(plugin_directory, "main.py")): + return PythonPlugin(plugin_directory, "main.py", flags, logger) + elif spec["type"] == "python": + return PythonPlugin(plugin_directory, spec["file"], flags, logger) + elif spec["type"] == "binary": + return BinaryPlugin(plugin_directory, spec["file"], flags, logger) + else: + return PassivePlugin(logger) |
