diff --git a/modules/api.py b/modules/api.py index 94ef4b7..cfbd87b 100644 --- a/modules/api.py +++ b/modules/api.py @@ -56,6 +56,10 @@ def setConfig(cfg, orig_cfg): config = cfg originalCfg = orig_cfg +def setModules(modulesList): + global modules + modules = modulesList + def getConfig(): return config diff --git a/modules/plugins.py b/modules/plugins.py index 9834cb2..c5a22ba 100644 --- a/modules/plugins.py +++ b/modules/plugins.py @@ -2,7 +2,7 @@ # This file contains the functions regarding the plugin manager. import git, shutil, os, imp -import security +import security, api import re indexes = {} @@ -92,7 +92,7 @@ def indexPlugins(params={}): if _check == 'summary' or _check == 'description': _text = re.sub('\n', '
', _text) fol[_check] = _text - + if not i in (f['folder'] for f in indexes.itervalues()): indexes[len(indexes)] = fol else: @@ -119,6 +119,7 @@ def indexPlugins(params={}): indexes[int(params['folid'])]['status'] = 'remove' global modules modules = loadPlugins() + api.setModules(modules) return indexes[int(params['folid'])]['folder'] + ' installed.' else: return "This plugin is already installed."