diff options
Diffstat (limited to 'pyload')
-rw-r--r-- | pyload/config/Parser.py | 7 | ||||
-rw-r--r-- | pyload/manager/Plugin.py | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/pyload/config/Parser.py b/pyload/config/Parser.py index e21eaba9f..84c08f17c 100644 --- a/pyload/config/Parser.py +++ b/pyload/config/Parser.py @@ -295,6 +295,13 @@ class ConfigParser(object): self.save() + def removeDeletedPlugins(self, plugins): + for name in self.plugin.keys(): + if not name in plugins: + print "delete config " + name + del self.plugin[name] + + def getMetaData(self, section, option): """ get all config data for an option """ return self.config[section][option] diff --git a/pyload/manager/Plugin.py b/pyload/manager/Plugin.py index f1899c0a0..222ed9c93 100644 --- a/pyload/manager/Plugin.py +++ b/pyload/manager/Plugin.py @@ -55,10 +55,15 @@ class PluginManager(object): sys.path.append(abspath("")) self.loadTypes() + + configs = [] for type in self.TYPES: self.plugins[type] = self.parse(type) setattr(self, "%sPlugins" % type, self.plugins[type]) + configs.extend("%s_%s" % (p, type) for p in self.plugins[type]) + + self.core.config.removeDeletedPlugins(configs) self.core.log.debug("Created index of plugins") |