MCPcopy Index your code
hub / github.com/pyload/pyload / Config

Class Config

module/plugins/internal/misc.py:56–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55
56class Config(object):
57
58 def __init__(self, plugin):
59 self.plugin = plugin
60
61 def set(self, option, value, plugin=None):
62 """
63 Set config value for current plugin
64
65 :param option:
66 :param value:
67 :return:
68 """
69 self.plugin.pyload.api.setConfigValue(plugin or self.plugin.classname, option, value, section="plugin")
70
71 def get(self, option, default=None, plugin=None):
72 """
73 Returns config value for current plugin
74
75 :param option:
76 :return:
77 """
78 try:
79 return self.plugin.pyload.config.getPlugin(plugin or self.plugin.classname, option)
80
81 except KeyError:
82 self.plugin.log_debug("Config option `%s` not found, use default `%s`" % (option, default)) # @TODO: Restore to `log_warning` in 0.4.10
83 return default
84
85
86class DB(object):

Callers 1

_initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected