Inheritance diagram for wx.ConfigBase:
wx.ConfigBase class defines the basic interface of all config classes. It can not be used by itself (it is an abstract base class) and you will always use one of its derivations: wx.FileConfig , wx.RegConfig or any other.
However, usually you don’t even need to know the precise nature of the class you’re working with but you would just use the wx.ConfigBase methods. This allows you to write the same code regardless of whether you’re working with the registry under Win32 or text-based config files under Unix (or even Windows 3.1 .INI files if you’re really unlucky). To make writing the portable code even easier, wxWidgets provides a typedef wx.Config which is mapped onto the native wx.ConfigBase implementation on the given platform: i.e. wx.RegConfig under Win32 and wx.FileConfig otherwise.
Here is how you would typically use this class:
# using wx.Config instead of writing wx.FileConfig enhances
# portability of the code
config = wx.Config("MyAppName")
strs = config.Read("LastPrompt")
if strs:
# last prompt was found in the config file/registry and its value is now
# in strs
DoSomething(strs)
else:
NoString()
Create a new config object: this function will create the “best” implementation of wx.Config available for the current platform.
It returns the created object and also sets it as the current one.
Returns:
Delete the whole underlying object (disk file, registry key, ...). Primarly for use by uninstallation routine.
Returns:
bool
Deletes the specified entry and the group it belongs to if it was the last key in it and the second parameter is True.
Parameters:
Returns:
bool
Delete the group (with all subgroups). If the current path is under the group being deleted it is changed to its deepest still existing component. E.g. if the current path is /A/B/C/D and the group C is deleted the path becomes /A/B.
Parameters:
Returns:
bool
returns True if either a group or an entry with a given name exists
Parameters:
Returns:
bool
Expand any environment variables in str and return the result
Parameters:
Returns:
string
permanently writes all changes (otherwise, they’re only written from object’s destructor)
Parameters:
Returns:
bool
Get the current config object. If there is no current object and CreateOnDemand is True, creates one (using Create) unless DontCreateOnDemand was called previously.
Parameters:
Returns:
Returns the application name.
Returns:
string
Returns the type of the given entry or Unknown if the entry doesn’t exist. This function should be used to decide which version of Read () should be used because some of wx.Config implementations will complain about type mismatch otherwise: e.g., an attempt to read a string value from an integer key with wx.RegConfig will fail.
Parameters:
Returns:
int
Gets the first entry.
Returns:
bool
Gets the first group.
Returns:
bool
Gets the next entry.
Parameters:
Returns:
bool
Gets the next group.
Parameters:
Returns:
bool
Parameters:
Returns:
uint
Get number of entries/subgroups in the current group, with or without its subgroups.
Parameters:
Returns:
uint
Retrieve the current path (always as absolute path).
Returns:
string
Returns the vendor name.
Returns:
string
returns True if the entry by this name exists.
Parameters:
Returns:
bool
returns True if the group by this name exists.
Parameters:
Returns:
bool
Returns True if we are expanding environment variables in key values.
Returns:
bool
Returns True if we are writing defaults back to the config file.
Returns:
bool
Reads a bool value, returning True if the value was found. If the value was not found, defaultVal is used instead.
Parameters:
Returns:
bool
Returns the value of key if it exists, defaultVal otherwise.
Parameters:
Returns:
bool
Returns the value of key if it exists, defaultVal otherwise.
Parameters:
Returns:
double
Returns the value of key if it exists, defaultVal otherwise.
Parameters:
Returns:
long
Renames an entry in the current group. The entries names (both the old and the new one) shouldn’t contain backslashes, i.e. only simple names and not arbitrary paths are accepted by this function.
Returns False if oldName doesn’t exist or if newName already exists.
Parameters:
Returns:
bool
Renames a subgroup of the current group. The subgroup names (both the old and the new one) shouldn’t contain backslashes, i.e. only simple names and not arbitrary paths are accepted by this function.
Returns False if oldName doesn’t exist or if newName already exists.
Parameters:
Returns:
bool
Sets the config object as the current one, returns the pointer to the previous current object (both the parameter and returned value may be None)
Parameters:
Returns:
Parameters:
Determine whether we wish to expand environment variables in key values.
Parameters:
Set current path: if the first character is ‘/’, it is the absolute path, otherwise it is a relative path. ‘..’ is supported.
If strPath doesn’t exist it is created.
Parameters:
Sets whether defaults are recorded to the config file whenever an attempt to read the value which is not present in it is done.
If on (default is off) all default values for the settings used by the program are written back to the config file. This allows the user to see what config options may be changed and is probably useful only for wx.FileConfig.
Parameters:
Parameters:
Parameters:
These functions write the specified value to the config file and return True on success.
Parameters:
Returns:
bool
write the value (return True on success)
Parameters:
Returns:
bool
write the value (return True on success)
Parameters:
Returns:
bool
write the value (return True on success)
Parameters:
Returns:
bool