summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/pluginmanager.py5
-rw-r--r--python/scriptingprovider.py5
2 files changed, 9 insertions, 1 deletions
diff --git a/python/pluginmanager.py b/python/pluginmanager.py
index 15b98b55..31e63620 100644
--- a/python/pluginmanager.py
+++ b/python/pluginmanager.py
@@ -50,6 +50,11 @@ class RepoPlugin(object):
return core.BNPluginGetPath(self.handle)
@property
+ def subdir(self):
+ """Optional sub-directory the plugin code lives in as a relative path from the plugin root"""
+ return core.BNPluginGetSubdir(self.handle)
+
+ @property
def dependencies(self):
"""Dependencies required for installing this plugin"""
return core.BNPluginGetDependencies(self.handle)
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py
index 51972ae9..473cd36f 100644
--- a/python/scriptingprovider.py
+++ b/python/scriptingprovider.py
@@ -831,7 +831,10 @@ class PythonScriptingProvider(ScriptingProvider):
if plugin_full_path not in sys.path:
sys.path.append(plugin_full_path)
- __import__(module)
+ if plugin.subdir:
+ __import__(module + "." + plugin.subdir.replace("/", "."))
+ else:
+ __import__(module)
return True
except KeyError:
log.log_error(f"Failed to find python plugin: {repo_path}/{module}")