doc/python/config.txt (raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
config.Config ---- This document describes the 'Config' class, exposed by Openbox's 'config' module to its python scripts. ---- Methods ---- add(modulename, name, friendlyname, description, type, default, **keywords): Add a variable to the configuration system for a module. modulename: The name of the module, e.g. 'focus' name: The name of the variable, e.g. 'my_variable' friendlyname: The user-friendly name of the variable, e.g. 'My Variable' description: The detailed destription of the variable, e.g. 'Does Things' type: The type of the variable, one of: * 'boolean' * 'enum' * 'integer' * 'string' * 'function' * 'object' default: The default value for the variable, e.g. 300 keywords: Extra keyword=value pairs to further define the variable. These can be: * For 'enum' types: * options : A list of possible options for the variable. This *must* be set for all enum variables. * For 'integer' types: * min : The minimum value for the variable. * max : The maximum value for the variable. ---- set(modulename, name, value): Sets the value for a variable of the specified module. modulename: The name of the module, e.g. 'focus' name: The name of the variable, e.g. 'my_variable' value: The new value for the variable. ---- reset(modulename, name): Resets the value for a variable in the specified module back to its original (default) value. modulename: The name of the module, e.g. 'focus' name: The name of the variable, e.g. 'my_variable' ---- get(modulename, name): Returns the current value for a variable in the specified module. modulename: The name of the module, e.g. 'focus' name: The name of the variable, e.g. 'my variable' |