Home | Trees | Index | Help |
|
---|
Package wx :: Class ConfigBase |
|
object
--+
|
ConfigBase
Config
,
FileConfig
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.Config or wx.FileConfig.
wx.ConfigBase organizes the items in a tree-like structure, modeled after the Unix/Dos filesystem. There are groups that act like directories and entries, key/value pairs that act like files. There is always one current group given by the current path. As in the file system case, to specify a key in the config class you must use a path to it. Config classes also support the notion of the current group, which makes it possible to use relative paths.
Keys are pairs "key_name = value" where value may be of string, integer floating point or boolean, you can not store binary data without first encoding it as a string. For performance reasons items should be kept small, no more than a couple kilobytes.
Method Summary | |
---|---|
__init__(self)
| |
__del__(self)
| |
ConfigBase |
Create and return a new global config object. (Static method) |
bool |
Delete the whole underlying object (disk file, registry key, ...) primarly intended for use by deinstallation routine. |
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 |
bool |
Delete the group (with all subgroups) |
Should Get() try to create a new log object if there isn't a current one? (Static method) | |
bool |
Returns True if either a group or an entry with a given name exists |
String |
Expand any environment variables in str and return the result |
bool |
permanently writes all changes |
ConfigBase |
Returns the current global config object, creating one if neccessary. (Static method) |
String | GetAppName(self)
|
int |
Get the type of the entry. |
(more, value, index) |
Allows enumerating the entries in the current group in a config object. |
(more, value, index) |
Allows enumerating the subgroups in a config object. |
(more, value, index) |
Allows enumerating the entries in the current group in a config object. |
(more, value, index) |
Allows enumerating the subgroups in a config object. |
size_t |
Get the number of entries in the current group, with or without its subgroups. |
size_t |
Get the number of subgroups in the current group, with or without its subgroups. |
String |
Retrieve the current path (always as absolute path) |
long | GetStyle(self)
|
String | GetVendorName(self)
|
bool |
Returns True if the entry by this name exists |
bool |
Returns True if the group by this name exists |
bool |
Are we currently expanding environment variables? |
bool |
Are we currently recording default values? |
String |
Returns the value of key if it exists, defaultVal otherwise. |
bool |
Returns the value of key if it exists, defaultVal otherwise. |
double |
Returns the value of key if it exists, defaultVal otherwise. |
long |
Returns the value of key if it exists, defaultVal otherwise. |
bool |
Rename an entry. |
bool |
Rename a group. |
ConfigBase |
Sets the global config object (the one returned by Get) and returns a reference to the previous global config object. (Static method) |
SetAppName(self,
appName)
| |
We can automatically expand environment variables in the config entries this option is on by default, you can turn it on/off at any time) | |
Set current path: if the first character is '/', it's the absolute path, otherwise it's a relative path. | |
Set whether the config objec should record default values. | |
SetStyle(self,
style)
| |
SetVendorName(self,
vendorName)
| |
bool |
write the value (return True on success) |
bool |
write the value (return True on success) |
bool |
write the value (return True on success) |
bool |
write the value (return True on success) |
Property Summary | |
---|---|
AppName : See GetAppName and SetAppName | |
EntryType : See GetEntryType | |
FirstEntry : See GetFirstEntry | |
FirstGroup : See GetFirstGroup | |
NextEntry : See GetNextEntry | |
NextGroup : See GetNextGroup | |
NumberOfEntries : See GetNumberOfEntries | |
NumberOfGroups : See GetNumberOfGroups | |
Path : See GetPath and SetPath | |
Style : See GetStyle and SetStyle | |
thisown : The membership flag | |
VendorName : See GetVendorName and SetVendorName |
Class Variable Summary | |
---|---|
int |
Type_Boolean = 2 |
int |
Type_Float = 4 |
int |
Type_Integer = 3 |
int |
Type_String = 1 |
int |
Type_Unknown = 0 |
Instance Method Details |
---|
DeleteAll(self)Delete the whole underlying object (disk file, registry key, ...) primarly intended for use by deinstallation routine.
|
DeleteEntry(self, key, deleteGroupIfEmpty=True)Deletes the specified entry and the group it belongs to if it was the last key in it and the second parameter is True
|
DeleteGroup(self, key)Delete the group (with all subgroups)
|
Exists(self, name)Returns True if either a group or an entry with a given name exists
|
ExpandEnvVars(self, str)Expand any environment variables in str and return the result
|
Flush(self, currentOnly=False)permanently writes all changes
|
GetEntryType(self, name)Get the type of the entry. Returns one of the wx.Config.Type_XXX values.
|
GetFirstEntry()Allows enumerating the entries in the current group in a config object. Returns a tuple containing a flag indicating there are more items, the name of the current item, and an index to pass to GetNextGroup to fetch the next item.
|
GetFirstGroup()Allows enumerating the subgroups in a config object. Returns a tuple containing a flag indicating there are more items, the name of the current item, and an index to pass to GetNextGroup to fetch the next item.
|
GetNextEntry(index)Allows enumerating the entries in the current group in a config object. Returns a tuple containing a flag indicating there are more items, the name of the current item, and an index to pass to GetNextGroup to fetch the next item.
|
GetNextGroup(index)Allows enumerating the subgroups in a config object. Returns a tuple containing a flag indicating there are more items, the name of the current item, and an index to pass to GetNextGroup to fetch the next item.
|
GetNumberOfEntries(self, recursive=False)Get the number of entries in the current group, with or without its subgroups.
|
GetNumberOfGroups(self, recursive=False)Get the number of subgroups in the current group, with or without its subgroups.
|
GetPath(self)Retrieve the current path (always as absolute path)
|
HasEntry(self, name)Returns True if the entry by this name exists
|
HasGroup(self, name)Returns True if the group by this name exists
|
IsExpandingEnvVars(self)Are we currently expanding environment variables?
|
IsRecordingDefaults(self)Are we currently recording default values?
|
Read(self, key, defaultVal=EmptyString)Returns the value of key if it exists, defaultVal otherwise.
|
ReadBool(self, key, defaultVal=False)Returns the value of key if it exists, defaultVal otherwise.
|
ReadFloat(self, key, defaultVal=0.0)Returns the value of key if it exists, defaultVal otherwise.
|
ReadInt(self, key, defaultVal=0)Returns the value of key if it exists, defaultVal otherwise.
|
RenameEntry(self, oldName, newName)Rename an entry. Returns False on failure (probably because the new name is already taken by an existing entry)
|
RenameGroup(self, oldName, newName)Rename a group. Returns False on failure (probably because the new name is already taken by an existing entry)
|
SetExpandEnvVars(self, doIt=True)We can automatically expand environment variables in the config entries this option is on by default, you can turn it on/off at any time)
|
SetPath(self, path)Set current path: if the first character is '/', it's the absolute path, otherwise it's a relative path. '..' is supported. If the strPath doesn't exist it is created.
|
SetRecordDefaults(self, doIt=True)Set whether the config objec should record default values.
|
Write(self, key, value)write the value (return True on success)
|
WriteBool(self, key, value)write the value (return True on success)
|
WriteFloat(self, key, value)write the value (return True on success)
|
WriteInt(self, key, value)write the value (return True on success)
|
Static Method Details |
---|
Create()Create and return a new global config object. This function will create the "best" implementation of wx.Config available for the current platform.
|
DontCreateOnDemand()Should Get() try to create a new log object if there isn't a current one? |
Get(createOnDemand=True)Returns the current global config object, creating one if neccessary.
|
Set(config)Sets the global config object (the one returned by Get) and returns a reference to the previous global config object.
|
Property Details |
---|
AppNameSee
|
EntryTypeSee
|
FirstEntrySee
|
FirstGroupSee
|
NextEntrySee
|
NextGroupSee
|
NumberOfEntries
|
NumberOfGroups
|
Path |
Style |
thisownThe membership flag |
VendorNameSee
|
Class Variable Details |
---|
Type_Boolean
|
Type_Float
|
Type_Integer
|
Type_String
|
Type_Unknown
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:12:14 2007 | http://epydoc.sf.net |