Home | Trees | Index | Help |
|
---|
Package wx :: Module _misc :: Class ConfigBase |
|
object
--+
|
ConfigBase
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) | |
__repr__(self)
| |
Create() -> ConfigBase (Static method) | |
DeleteAll(self) -> bool | |
DeleteEntry(self, String key, bool deleteGroupIfEmpty=True) -> bool | |
DeleteGroup(self, String key) -> bool | |
DontCreateOnDemand() (Static method) | |
Exists(self, String name) -> bool | |
ExpandEnvVars(self, String str) -> String | |
Flush(self, bool currentOnly=False) -> bool | |
Get(bool createOnDemand=True) -> ConfigBase (Static method) | |
GetAppName(self) -> String | |
GetEntryType(self, String name) -> int | |
GetFirstEntry() -> (more, value, index) | |
GetFirstGroup() -> (more, value, index) | |
GetNextEntry(long index) -> (more, value, index) | |
GetNextGroup(long index) -> (more, value, index) | |
GetNumberOfEntries(self, bool recursive=False) -> size_t | |
GetNumberOfGroups(self, bool recursive=False) -> size_t | |
GetPath(self) -> String | |
GetStyle(self) -> long | |
GetVendorName(self) -> String | |
HasEntry(self, String name) -> bool | |
HasGroup(self, String name) -> bool | |
IsExpandingEnvVars(self) -> bool | |
IsRecordingDefaults(self) -> bool | |
Read(self, String key, String defaultVal=EmptyString) -> String | |
ReadBool(self, String key, bool defaultVal=False) -> bool | |
ReadFloat(self, String key, double defaultVal=0.0) -> double | |
ReadInt(self, String key, long defaultVal=0) -> long | |
RenameEntry(self, String oldName, String newName) -> bool | |
RenameGroup(self, String oldName, String newName) -> bool | |
Set(ConfigBase config) -> ConfigBase (Static method) | |
SetAppName(self, String appName) | |
SetExpandEnvVars(self, bool doIt=True) | |
SetPath(self, String path) | |
SetRecordDefaults(self, bool doIt=True) | |
SetStyle(self, long style) | |
SetVendorName(self, String vendorName) | |
Write(self, String key, String value) -> bool | |
WriteBool(self, String key, bool value) -> bool | |
WriteFloat(self, String key, double value) -> bool | |
WriteInt(self, String key, long value) -> bool | |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
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 |
---|
__del__(self,
destroy=<built-in function delete_ConfigBase>)
__del__(self)
|
DeleteAll(*args, **kwargs)DeleteAll(self) -> bool Delete the whole underlying object (disk file, registry key, ...) primarly intended for use by deinstallation routine. |
DeleteEntry(*args, **kwargs)DeleteEntry(self, String key, bool deleteGroupIfEmpty=True) -> 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 |
DeleteGroup(*args, **kwargs)DeleteGroup(self, String key) -> bool Delete the group (with all subgroups) |
Exists(*args, **kwargs)Exists(self, String name) -> bool Returns True if either a group or an entry with a given name exists |
ExpandEnvVars(*args, **kwargs)ExpandEnvVars(self, String str) -> String Expand any environment variables in str and return the result |
Flush(*args, **kwargs)Flush(self, bool currentOnly=False) -> bool permanently writes all changes |
GetAppName(*args, **kwargs)GetAppName(self) -> String |
GetEntryType(*args, **kwargs)GetEntryType(self, String name) -> int Get the type of the entry. Returns one of the wx.Config.Type_XXX values. |
GetFirstEntry(*args, **kwargs)GetFirstEntry() -> (more, value, 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. |
GetFirstGroup(*args, **kwargs)GetFirstGroup() -> (more, value, 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. |
GetNextEntry(*args, **kwargs)GetNextEntry(long index) -> (more, value, 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(*args, **kwargs)GetNextGroup(long index) -> (more, value, 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(*args, **kwargs)GetNumberOfEntries(self, bool recursive=False) -> size_t Get the number of entries in the current group, with or without its subgroups. |
GetNumberOfGroups(*args, **kwargs)GetNumberOfGroups(self, bool recursive=False) -> size_t Get the number of subgroups in the current group, with or without its subgroups. |
GetPath(*args, **kwargs)GetPath(self) -> String Retrieve the current path (always as absolute path) |
GetStyle(*args, **kwargs)GetStyle(self) -> long |
GetVendorName(*args, **kwargs)GetVendorName(self) -> String |
HasEntry(*args, **kwargs)HasEntry(self, String name) -> bool Returns True if the entry by this name exists |
HasGroup(*args, **kwargs)HasGroup(self, String name) -> bool Returns True if the group by this name exists |
IsExpandingEnvVars(*args, **kwargs)IsExpandingEnvVars(self) -> bool Are we currently expanding environment variables? |
IsRecordingDefaults(*args, **kwargs)IsRecordingDefaults(self) -> bool Are we currently recording default values? |
Read(*args, **kwargs)Read(self, String key, String defaultVal=EmptyString) -> String Returns the value of key if it exists, defaultVal otherwise. |
ReadBool(*args, **kwargs)ReadBool(self, String key, bool defaultVal=False) -> bool Returns the value of key if it exists, defaultVal otherwise. |
ReadFloat(*args, **kwargs)ReadFloat(self, String key, double defaultVal=0.0) -> double Returns the value of key if it exists, defaultVal otherwise. |
ReadInt(*args, **kwargs)ReadInt(self, String key, long defaultVal=0) -> long Returns the value of key if it exists, defaultVal otherwise. |
RenameEntry(*args, **kwargs)RenameEntry(self, String oldName, String newName) -> bool Rename an entry. Returns False on failure (probably because the new name is already taken by an existing entry) |
RenameGroup(*args, **kwargs)RenameGroup(self, String oldName, String newName) -> bool Rename a group. Returns False on failure (probably because the new name is already taken by an existing entry) |
SetAppName(*args, **kwargs)SetAppName(self, String appName) |
SetExpandEnvVars(*args, **kwargs)SetExpandEnvVars(self, bool 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(*args, **kwargs)SetPath(self, String 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(*args, **kwargs)SetRecordDefaults(self, bool doIt=True) Set whether the config objec should record default values. |
SetStyle(*args, **kwargs)SetStyle(self, long style) |
SetVendorName(*args, **kwargs)SetVendorName(self, String vendorName) |
Write(*args, **kwargs)Write(self, String key, String value) -> bool write the value (return True on success) |
WriteBool(*args, **kwargs)WriteBool(self, String key, bool value) -> bool write the value (return True on success) |
WriteFloat(*args, **kwargs)WriteFloat(self, String key, double value) -> bool write the value (return True on success) |
WriteInt(*args, **kwargs)WriteInt(self, String key, long value) -> bool write the value (return True on success) |
Static Method Details |
---|
Create(*args, **kwargs)Create() -> ConfigBase Create and return a new global config object. This function will create the "best" implementation of wx.Config available for the current platform. |
DontCreateOnDemand(*args, **kwargs)DontCreateOnDemand() Should Get() try to create a new log object if there isn't a current one? |
Get(*args, **kwargs)Get(bool createOnDemand=True) -> ConfigBase Returns the current global config object, creating one if neccessary. |
Set(*args, **kwargs)Set(ConfigBase config) -> ConfigBase Sets the global config object (the one returned by Get) and returns a reference to the previous global config object. |
Class Variable Details |
---|
Type_Boolean
|
Type_Float
|
Type_Integer
|
Type_String
|
Type_Unknown
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Feb 4 18:01:16 2007 | http://epydoc.sf.net |