This module provides the profile object and support functions for loading and saving user preferences between sessions. The preferences are saved on disk as a cPickle, because of this no objects that cannot be resolved in the namespace of this module prior to starting the mainloop must not be put in the Profile as it will cause errors on load. Ths means that only builtin python types should be used and that a translation from that type to the required type should happen during run time.
Summary: Editra’s user profile management
CalcVersionValue | Calculates a version value from the provided dot-formated string |
GetLoader | Finds the loader to use |
GetProfileStr | Reads the profile string from the loader and returns it. |
ProfileIsCurrent | Checks if profile is compatible with current editor version |
ProfileVersionStr | Checks the Loader for the profile version string and |
UpdateProfileLoader | Updates Loader File |
Profile | Class for managing profile data. All data is stored as builtin |
Calculates a version value from the provided dot-formated string
Parameters: | ver_str – Version string to calculate value of |
---|
Finds the loader to use
Returns: | path to profile loader |
---|
Note
path may not exist, only returns the path to where the loader should be.
Reads the profile string from the loader and returns it. The profile string must be the first line in the loader file.
Returns: | path of profile used in last session |
---|
Checks if profile is compatible with current editor version and returns a bool stating if it is or not.
Returns: | whether profile on disk was written with current program version |
---|
Checks the Loader for the profile version string and returns the version string. If there is an error or the string is not found it returns a zero version string.
Returns: | the version string value from the profile loader file |
---|
Updates Loader File
Precondition : | MYPROFILE has been set |
---|---|
Postcondition : | on disk profile loader is updated |
Returns: | 0 if no error, non zero for error condition |