module documentation

Version utilities.

Function BuildVersion Calculates int version number from major, minor and revision numbers.
Function IsBefore Decide if a given version is strictly before a given version.
Function IsCorrectConfigVersion Decide whether configuration version is compatible with the target.
Function IsEqual Decide if a given version matches the given version.
Function ParseVersion Parses a version string.
Function ShouldCfgdowngrade Decide whether cfgupgrade --downgrade should be called.
Function SplitVersion Splits version number stored in an int.
Function UpgradeRange Verify whether a version is within the range of automatic upgrades.
Constant CURRENT_VERSION Undocumented
Constant FIRST_UPGRADE_VERSION Undocumented
Constant _FULL_VERSION_RE Undocumented
Constant _SHORT_VERSION_RE Undocumented
def BuildVersion(major, minor, revision):

Calculates int version number from major, minor and revision numbers.

Returns: int representing version number

def IsBefore(version, major, minor, revision):

Decide if a given version is strictly before a given version.

Parameters
version:(int, int, int) or None(major, minor, revision) or None, with None being before all versions
major:intmajor version
minor:intminor version
revision:intrevision
def IsCorrectConfigVersion(targetversion, configversion):

Decide whether configuration version is compatible with the target.

Parameters
targetversion:tupleThe version to upgrade to as (major, minor, revision)
configversion:tupleThe version of the current configuration
Returns
boolTrue, if the configversion fits with the target version.
def IsEqual(version, major, minor, revision):

Decide if a given version matches the given version.

If the revision is set to None, only major and minor are compared.

Parameters
version:(int, int, int) or None(major, minor, revision) or None, with None being before all versions
major:intmajor version
minor:intminor version
revision:intrevision
def ParseVersion(versionstring):

Parses a version string.

Parameters
versionstring:stringthe version string to parse
Returns
tuple or None(major, minor, revision) if parsable, None otherwise.
def ShouldCfgdowngrade(version, current=CURRENT_VERSION):

Decide whether cfgupgrade --downgrade should be called.

Given the current version and the version to change to, decide if in the transition process cfgupgrade --downgrade should be called

Parameters
version:tupleThe version to upgrade to as (major, minor, revision)
current:tupleThe version to upgrade from as (major, minor, revision)
Returns
boolTrue, if cfgupgrade --downgrade should be called.
def SplitVersion(version):

Splits version number stored in an int.

Returns: tuple; (major, minor, revision)

def UpgradeRange(target, current=CURRENT_VERSION):

Verify whether a version is within the range of automatic upgrades.

Parameters
target:tupleThe version to upgrade to as (major, minor, revision)
current:tupleThe version to upgrade from as (major, minor, revision)
Returns
string or NoneNone, if within the range, and a human-readable error message otherwise
FIRST_UPGRADE_VERSION: tuple[int, ...] =

Undocumented

Value
(2, 10, 0)
_FULL_VERSION_RE =

Undocumented

Value
re.compile(r'(\d+)\.(\d+)\.(\d+)')
_SHORT_VERSION_RE =

Undocumented

Value
re.compile(r'(\d+)\.(\d+)')