PersistentObject: ABC for anything persistent.
This is the base class for persistent object adapters. wxPython persistence framework is non-intrusive, i.e. can work with the classes which have no relationship to nor knowledge of it. To allow this, an intermediate persistence adapter is used: this is just a simple object which provides the methods used by PersistenceManager to save and restore the object properties and implements them using the concrete class methods.
You may derive your own classes from PersistentObject to implement persistence support for your common classes, see Defining Custom Persistent Windows in the __init__.py file.
__init__ | Default class constructor. |
GetKind | Returns the string uniquely identifying the objects supported by this adapter. |
GetName | Returns the string uniquely identifying the window we’re associated with among all the other objects of the same type. |
GetWindow | Returns the actual associated window. |
Restore | Restores the corresponding window settings. |
RestoreCtrlValue | Restore the value saved by SaveCtrlValue, should be used only for |
RestoreValue | Restore the value saved by SaveValue. |
Save | Saves the corresponding window settings. |
SaveCtrlValue | Save the specified value using the given name, should be used only for controls data value. |
SaveValue | Save the specified value using the given name. |
PersistentObject: ABC for anything persistent.
This is the base class for persistent object adapters. wxPython persistence framework is non-intrusive, i.e. can work with the classes which have no relationship to nor knowledge of it. To allow this, an intermediate persistence adapter is used: this is just a simple object which provides the methods used by PersistenceManager to save and restore the object properties and implements them using the concrete class methods.
You may derive your own classes from PersistentObject to implement persistence support for your common classes, see Defining Custom Persistent Windows in the __init__.py file.
Default class constructor.
Parameters: |
|
---|
Returns the string uniquely identifying the objects supported by this adapter.
Note
This method is called from SaveValue and RestoreValue and normally returns some short (but not too cryptic) strings, e.g. “Checkbox”.
Returns the string uniquely identifying the window we’re associated with among all the other objects of the same type.
Note
This method is used together with GetKind to construct the unique full name of the object in e.g. a configuration file.
Restores the corresponding window settings.
Note
This method shouldn’t be used directly as it doesn’t respect the global PersistenceManager.DisableRestoring() settings, use PersistenceManager methods with the same name instead.
Restore the value saved by SaveCtrlValue, should be used only for controls data value.
Parameters: | name – the same name as was used by SaveCtrlValue. |
---|---|
Returns: | True if the value was successfully read or False if it was not found or an error occurred. |
Restore the value saved by SaveValue.
Parameters: | name – the same name as was used by SaveValue. |
---|---|
Returns: | True if the value was successfully read or False if it was not found or an error occurred. |
Saves the corresponding window settings.
Note
This method shouldn’t be used directly as it doesn’t respect the global PersistenceManager.DisableSaving() settings, use PersistenceManager methods with the same name instead.
Save the specified value using the given name, should be used only for controls data value.
Parameters: |
|
---|---|
Returns: | True if the value was saved or False if an error occurred. |