MCPcopy Create free account
hub / github.com/pyload/pyload / setConfigValue

Method setConfigValue

module/Api.py:141–158  ·  view source on GitHub ↗

Set new config value. :param category: :param option: :param value: new config value :param section: 'plugin' or 'core

(self, category, option, value, section="core")

Source from the content-addressed store, hash-verified

139
140 @permission(PERMS.SETTINGS)
141 def setConfigValue(self, category, option, value, section="core"):
142 """Set new config value.
143
144 :param category:
145 :param option:
146 :param value: new config value
147 :param section: 'plugin' or 'core
148 """
149 self.core.hookManager.dispatchEvent("configChanged", category, option, value, section)
150
151 if section == "core":
152 self.core.config[category][option] = value
153
154 if option in ("limit_speed", "max_speed"): #not so nice to update the limit
155 self.core.requestFactory.updateBucket()
156
157 elif section == "plugin":
158 self.core.config.setPlugin(category, option, value)
159
160 @permission(PERMS.SETTINGS)
161 def getConfig(self):

Callers

nothing calls this directly

Calls 3

dispatchEventMethod · 0.80
updateBucketMethod · 0.80
setPluginMethod · 0.80

Tested by

no test coverage detected