Bases: object
A setting and associated value stored in a configuration file.
These objects should be created as members of ConfigNamespace subclasses, for example:
class _Conf(config.ConfigNamespace):
unicode_output = config.ConfigItem(
False,
'Use Unicode characters when outputting values, and writing widgets '
'to the console.')
conf = _Conf()
Parameters: | defaultvalue : object, optional
description : str or None, optional
cfgtype : str or None, optional
module : str or None, optional
aliases : str, or list of str, optional
|
---|---|
Raises: | RuntimeError
|
Methods Summary
__call__() | Returns the value of this ConfigItem |
reload() | Reloads the value of this ConfigItem from the relevant configuration file. |
set(value) | Sets the current value of this ConfigItem. |
set_temp(*args, **kwds) | Sets this item to a specified value only inside a with block. |
Methods Documentation
Returns the value of this ConfigItem
Returns: | val
|
---|---|
Raises: | TypeError
|
Reloads the value of this ConfigItem from the relevant configuration file.
Returns: | val
|
---|
Sets the current value of this ConfigItem.
This also updates the comments that give the description and type information.
Parameters: | value
|
---|---|
Raises: | TypeError
|
Sets this item to a specified value only inside a with block.
ITEM = ConfigItem(‘ITEM’, ‘default’, ‘description’)
... do something that wants ITEM’s value to be ‘newval’ ...
# ITEM is now ‘default’ after the with block
Parameters: | value
|
---|