summaryrefslogtreecommitdiffstats
path: root/pyload/api/__init__.py
diff options
context:
space:
mode:
authorGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-18 15:03:47 +0200
committerGravatar Armin <Armin@Armin-PC.diedering.lan> 2015-04-18 15:03:47 +0200
commit2deaf64acf3afba168ef85e7dd75578f22b9b2e7 (patch)
tree13d9864894ed65c3543d8ad1f61c0d683d4c4881 /pyload/api/__init__.py
parentfixed: show "all" logs in webui (diff)
downloadpyload-2deaf64acf3afba168ef85e7dd75578f22b9b2e7.tar.xz
fix: color_logger
revert partially Spare code cosmetics (1) to fix SyntaxError: duplicate argument 'section' in function definition
Diffstat (limited to 'pyload/api/__init__.py')
-rw-r--r--pyload/api/__init__.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/pyload/api/__init__.py b/pyload/api/__init__.py
index 62af70cf8..b5c1dfbf4 100644
--- a/pyload/api/__init__.py
+++ b/pyload/api/__init__.py
@@ -120,23 +120,23 @@ class Api(Iface):
@permission(PERMS.SETTINGS)
- def getConfigValue(self, section, option, section="core"):
+ def getConfigValue(self, category, option, section="core"):
"""Retrieve config value.
- :param section: name of section, or plugin
+ :param category: name of category, or plugin
:param option: config option
:param section: 'plugin' or 'core'
:return: config value as string
"""
if section == "core":
- value = self.core.config.get(section, option)
+ value = self.core.config[category][option]
else:
- value = self.core.config.getPlugin(section, option)
+ value = self.core.config.getPlugin(category, option)
return str(value)
@permission(PERMS.SETTINGS)
- def setConfigValue(self, section, option, value, section="core"):
+ def setConfigValue(self, category, option, value, section="core"):
"""Set new config value.
:param section:
@@ -144,13 +144,13 @@ class Api(Iface):
:param value: new config value
:param section: 'plugin' or 'core
"""
- self.core.addonManager.dispatchEvent("config-changed", section, option, value, section)
+ self.core.addonManager.dispatchEvent("config-changed", category, option, value, section)
if section == "core":
- self.core.config.set(section, option, value)
+ self.core.config[category][option] = value
if option in ("limit_speed", "max_speed"): # not so nice to update the limit
self.core.requestFactory.updateBucket()
elif section == "plugin":
- self.core.config.setPlugin(section, option, value)
+ self.core.config.setPlugin(category, option, value)
@permission(PERMS.SETTINGS)