summaryrefslogtreecommitdiffstats
path: root/module/plugins/PluginManager.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/PluginManager.py')
-rw-r--r--module/plugins/PluginManager.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py
index e263f8e04..034e40d4a 100644
--- a/module/plugins/PluginManager.py
+++ b/module/plugins/PluginManager.py
@@ -60,6 +60,7 @@ class PluginManager:
self.log.debug("created index of plugins")
+
def parse(self, folder, pattern=False, home={}):
"""
returns dict with information
@@ -211,12 +212,14 @@ class PluginManager:
return res
+
def findPlugin(self, name, pluginlist=("hoster", "crypter", "container")):
for ptype in pluginlist:
if name in self.plugins[ptype]:
return self.plugins[ptype][name], ptype
return None, None
+
def getPlugin(self, name, original=False):
"""return plugin module from hoster|decrypter|container"""
plugin, type = self.findPlugin(name)
@@ -230,6 +233,7 @@ class PluginManager:
return self.loadModule(type, name)
+
def getPluginName(self, name):
""" used to obtain new name if other plugin was injected"""
plugin, type = self.findPlugin(name)
@@ -239,6 +243,7 @@ class PluginManager:
return name
+
def loadModule(self, type, name):
""" Returns loaded module for plugin
@@ -258,15 +263,18 @@ class PluginManager:
if self.core.debug:
print_exc()
+
def loadClass(self, type, name):
"""Returns the class of a plugin with the same name"""
module = self.loadModule(type, name)
if module: return getattr(module, name)
+
def getAccountPlugins(self):
"""return list of account plugin names"""
return self.accountPlugins.keys()
+
def find_module(self, fullname, path=None):
#redirecting imports if necesarry
if fullname.startswith(self.ROOT) or fullname.startswith(self.USERROOT): #seperate pyload plugins