Class c.config:

Part of config View In Hierarchy

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.
Method set Undocumented
Method delete
>>> c=config()
Method getNetworks Undocumented
Method getChannels Undocumented
Method exportyaml Undocumented
Method setConfig Undocumented
Method delConfig Undocumented
Method hasConfig Undocumented
Method getConfig Undocumented
Method getPathConfig Undocumented
Method getBoolConfig
>>> c=config()
Method writeConfig Undocumented
def __init__(self, filename=None, is_subconfig=False):
Initialize the config class and load a config
def get(self, option, default, module=None, network=None, channel=None, set_default=True):
get an option and set the default value, if the option is unset.
@param set_default if 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.

>>> c=config()
>>> c.get("option", "default")
'default'
>>> c.get("option", "unset?")
'default'
def has(self, option, module=None):

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

>>> c=config()
>>> 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):
Undocumented
def delete(self, option, module=None, network=None, channel=None):
>>> c=config()
>>> c.set("key", "value")
>>> c.get("key", "unset")
'value'
>>> c.delete("key")
>>> c.get("key", "unset")
'unset'
def getNetworks(self):
Undocumented
def getChannels(self, network):
Undocumented
def exportyaml(self):
Undocumented
def setConfig(self, option, value, module=None, network=None, channel=None):
Undocumented
def delConfig(self, option, module=None, network=None, channel=None):
Undocumented
def hasConfig(self, option, module=None):
Undocumented
def getConfig(self, option, defaultvalue='', module=None, network=None, channel=None, set_default=True):
Undocumented
def getPathConfig(self, option, datadir, defaultvalue='', module=None, network=None, channel=None):
Undocumented
def getBoolConfig(self, option, defaultvalue='', module=None, network=None, channel=None):
>>> c=config()
>>> c.set("key", "1")
>>> c.set("key2", "on")
>>> c.set("key3", "True")
>>> c.getBoolConfig("key") and c.getBoolConfig("key2") and c.getBoolConfig("key3")
True
>>> c.set("key", "False")
>>> c.set("key2", "any string which is not in [True, true, on, On, 1]")
>>> c.getBoolConfig("key") or c.getBoolConfig("key2")
False
def writeConfig(self):
Undocumented
API Documentation for OtfBot, generated by pydoctor at 2010-01-14 18:51:57.