diff options
-rw-r--r-- | module/HookManager.py | 2 | ||||
-rw-r--r-- | module/plugins/Plugin.py | 19 | ||||
-rw-r--r-- | module/plugins/PluginManager.py | 8 |
3 files changed, 15 insertions, 14 deletions
diff --git a/module/HookManager.py b/module/HookManager.py index 62e53e783..65c448437 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -123,7 +123,7 @@ class HookManager: try: #hookClass = getattr(plugin, plugin.__name__) - if self.core.config.getPlugin(pluginname, "activated"): + if self.config.getPlugin(pluginname, "activated"): pluginClass = self.core.pluginManager.loadClass("hooks", pluginname) if not pluginClass: continue diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index c12a7f114..d23c0cfcb 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -90,7 +90,7 @@ class Base(object): def setConf(self, option, value): """ see `setConfig` """ - self.core.config.setPlugin(self.__name__, option, value) + self.config.setPlugin(self.__name__, option, value) def setConfig(self, option, value): """ Set config value for current plugin @@ -101,9 +101,10 @@ class Base(object): """ self.setConf(option, value) + #: Deprecated method def getConf(self, option): """ see `getConfig` """ - return self.core.config.getPlugin(self.__name__, option) + return self.getConfig(option) def getConfig(self, option): """ Returns config value for current plugin @@ -111,7 +112,7 @@ class Base(object): :param option: :return: """ - return self.getConf(option) + return self.config.getPlugin(self.__name__, option) def setStorage(self, key, value): """ Saves a value persistently to the database """ @@ -503,9 +504,9 @@ class Plugin(Base): location = safe_join(download_folder, self.pyfile.package().folder) if not exists(location): - makedirs(location, int(self.core.config["permission"]["folder"], 8)) + makedirs(location, int(self.config["permission"]["folder"], 8)) - if self.core.config["permission"]["change_dl"] and os.name != "nt": + if self.config["permission"]["change_dl"] and os.name != "nt": try: uid = getpwnam(self.config["permission"]["user"])[2] gid = getgrnam(self.config["permission"]["group"])[2] @@ -536,10 +537,10 @@ class Plugin(Base): fs_filename = fs_encode(filename) - if self.core.config["permission"]["change_file"]: - chmod(fs_filename, int(self.core.config["permission"]["file"], 8)) + if self.config["permission"]["change_file"]: + chmod(fs_filename, int(self.config["permission"]["file"], 8)) - if self.core.config["permission"]["change_dl"] and os.name != "nt": + if self.config["permission"]["change_dl"] and os.name != "nt": try: uid = getpwnam(self.config["permission"]["user"])[2] gid = getgrnam(self.config["permission"]["group"])[2] @@ -617,7 +618,7 @@ class Plugin(Base): download_folder = self.config['general']['download_folder'] location = safe_join(download_folder, pack.folder, self.pyfile.name) - if starting and self.core.config['download']['skip_existing'] and exists(location): + if starting and self.config['download']['skip_existing'] and exists(location): size = os.stat(location).st_size if size >= self.pyfile.size: raise SkipDownload("File exists.") diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index 464e8779c..8b7ed9bf2 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -43,7 +43,7 @@ class PluginManager: def __init__(self, core): self.core = core - #self.config = self.core.config + self.config = core.config self.log = core.log self.plugins = {} @@ -155,7 +155,7 @@ class PluginManager: # internals have no config if folder == "internal": - self.core.config.deleteConfig(name) + self.config.deleteConfig(name) continue config = self.CONFIG.findall(content) @@ -178,7 +178,7 @@ class PluginManager: if append: config.append(["activated", "bool", "Activated", False]) try: - self.core.config.addPluginConfig(name, config, desc) + self.config.addPluginConfig(name, config, desc) except: self.log.error("Invalid config in %s: %s" % (name, config)) @@ -188,7 +188,7 @@ class PluginManager: config = (["activated", "bool", "Activated", False],) try: - self.core.config.addPluginConfig(name, config, desc) + self.config.addPluginConfig(name, config, desc) except: self.log.error("Invalid config in %s: %s" % (name, config)) |