No class docstring
Method __init__ Initialize the config class and load a config
Method get get an option and set the default value, if the option is unset.
Method has Test, in which networks/channels a option is set. Returns a tuple: (general_bool, network_list, (network, channel) list)
Method set Undocumented
Method delete No summary
Method getNetworks Undocumented
Method getChannels Undocumented
Method setConfig Undocumented
Method delConfig Undocumented
Method hasConfig Undocumented
Method getConfig Undocumented
Method getPath Undocumented
Method getBool No summary
Method writeConfig Undocumented
Method startService Undocumented
Method stopService Undocumented
Method _create_preceding create preceding dictionary entries for network/channel options
def __init__(self, filename=None, is_subconfig=False): (source)

Initialize the config class and load a config

def _create_preceding(self, network, channel=None): (source)

create preceding dictionary entries for network/channel options

>>> c=configService()
>>> c.network_options
{}
>>> c._create_preceding("samplenetwork", "#samplechannel")
>>> c.network_options
{'samplenetwork': {'#samplechannel': {}}}
>>> c._create_preceding("othernetwork")
>>> c.network_options
{'othernetwork': {}, 'samplenetwork': {'#samplechannel': {}}}
def get(self, option, default, module=None, network=None, channel=None, set_default=True): (source)

get an option and set the default value, if the option is unset.

>>> c=configService()
>>> c.get("option", "default")
'default'
>>> c.get("option", "unset?")
'default'
Parametersset_defaultif True, the default will be set in the config, if its used. If False, the default will be returned, but the config will not be changed.
def has(self, option, module=None): (source)

Test, in which networks/channels a option is set. Returns a tuple: (general_bool, network_list, (network, channel) list)

>>> c=configService()
>>> c.has("testkey")
(False, [], [])
>>> c.set("testkey", "testvalue")
>>> c.has("testkey")
(True, [], [])
>>> c.set("testkey", "othervalue", network="samplenetwork")
>>> c.has("testkey")
(True, ['samplenetwork'], [])
def set(self, option, value, module=None, network=None, channel=None, still_default=False): (source)
Undocumented
def delete(self, option, module=None, network=None, channel=None): (source)
>>> c=configService()
>>> c.set("key", "value")
>>> c.get("key", "unset")
'value'
>>> c.delete("key")
>>> c.get("key", "unset")
'unset'
def getNetworks(self): (source)
Undocumented
def getChannels(self, network): (source)
Undocumented
def setConfig(self, opt, value, module=None, network=None, channel=None): (source)
Undocumented
def delConfig(self, opt, module=None, network=None, channel=None): (source)
Undocumented
def hasConfig(self, option, module=None): (source)
Undocumented
def getConfig(self, option, defaultvalue='', module=None, network=None, channel=None, set_default=True): (source)
Undocumented
def getPath(self, option, datadir, defaultvalue='', module=None, network=None, channel=None): (source)
Undocumented
def getBool(self, option, defaultvalue='', module=None, network=None, channel=None): (source)
>>> c=configService()
>>> c.set("key", "1")
>>> c.set("key2", "on")
>>> c.set("key3", "True")
>>> c.getBool("key") and c.getBool("key2") and c.getBool("key3")
True
>>> c.set("key", "False")
>>> c.set("key2", "any string which is not in [True, true, on, On, 1]")
>>> c.getBool("key") or c.getBool("key2")
False
def writeConfig(self): (source)
Undocumented
def startService(self): (source)
Undocumented
def stopService(self): (source)
Undocumented
API Documentation for OtfBot, generated by pydoctor at 2020-03-04 02:00:06.