Config object is an instance of a modified Python ConfigParser. See ConfigParser documentation for more information.
Read a configuration token from a particular section:
>>> from kivy.config import Config
>>> Config.getint('kivy', 'show_fps')
0
Change the configuration and save it:
>>> Config.set('kivy', 'retain_time', 50)
>>> Config.write()
kivy: |
|
---|---|
postproc: |
|
graphics: |
|
input: | Input section is particular. You can create new input device with this syntax: # example of input provider instance
yourid = providerid,parameters
# example for tuio provider
default = tuio,127.0.0.1:3333
mytable = tuio,192.168.0.1:3334
See also Check all the providers in kivy.input.providers for the syntax to use inside the configuration file. |
widgets: |
|
modules: | You can activate modules with this syntax: modulename =
Anything after the = will be passed to the module as arguments. Check the specific module’s documentation for a list of accepted arguments. |
Kivy configuration object
Bases: ConfigParser.ConfigParser
Enhanced ConfigParser class, that support the possibility of add default sections and default values.
Add a section if the section is missing.
Get an option. If not found, it will return the defaultvalue
Set the default value on a particular option
Write the configuration to the default kivy file