summaryrefslogtreecommitdiffstats
path: root/module/plugins/Plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/Plugin.py')
-rw-r--r--module/plugins/Plugin.py19
1 files changed, 10 insertions, 9 deletions
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.")