Table Of Contents

Previous topic

UpdatePage

Next topic

Profile

This Page

phoenix_title profiler

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


class_hierarchy Inheritance Diagram

Inheritance diagram for module profiler

Inheritance diagram of profiler


function_summary Functions Summary

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

class_summary Classes Summary

Profile Class for managing profile data. All data is stored as builtin

Functions



CalcVersionValue(ver_str="0.0.0")

Calculates a version value from the provided dot-formated string

  1. SPECIFICATION: Version value calculation AA.BBB.CCC
    • major values: < 1 (i.e 0.0.85 = 0.850)
    • minor values: 1 - 999 (i.e 0.1.85 = 1.850)
    • micro values: >= 1000 (i.e 1.1.85 = 1001.850)
Parameters:ver_str – Version string to calculate value of


GetLoader()

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.



GetProfileStr()

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


ProfileIsCurrent()

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


ProfileVersionStr()

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


UpdateProfileLoader()

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