module documentation
Version utilities.
Function |
|
Calculates int version number from major, minor and revision numbers. |
Function |
|
Decide if a given version is strictly before a given version. |
Function |
|
Decide whether configuration version is compatible with the target. |
Function |
|
Decide if a given version matches the given version. |
Function |
|
Parses a version string. |
Function |
|
Decide whether cfgupgrade --downgrade should be called. |
Function |
|
Splits version number stored in an int. |
Function |
|
Verify whether a version is within the range of automatic upgrades. |
Constant | CURRENT |
Undocumented |
Constant | FIRST |
Undocumented |
Constant | _FULL |
Undocumented |
Constant | _SHORT |
Undocumented |
Calculates int version number from major, minor and revision numbers.
Returns: int representing version number
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:int | major version |
minor:int | minor version |
revision:int | revision |
Decide whether configuration version is compatible with the target.
Parameters | |
targetversion:tuple | The version to upgrade to as (major, minor, revision) |
configversion:tuple | The version of the current configuration |
Returns | |
bool | True, if the configversion fits with the target version. |
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:int | major version |
minor:int | minor version |
revision:int | revision |
Parses a version string.
Parameters | |
versionstring:string | the version string to parse |
Returns | |
tuple or None | (major, minor, revision) if parsable, None otherwise. |
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:tuple | The version to upgrade to as (major, minor, revision) |
current:tuple | The version to upgrade from as (major, minor, revision) |
Returns | |
bool | True, if cfgupgrade --downgrade should be called. |
Verify whether a version is within the range of automatic upgrades.
Parameters | |
target:tuple | The version to upgrade to as (major, minor, revision) |
current:tuple | The version to upgrade from as (major, minor, revision) |
Returns | |
string or None | None, if within the range, and a human-readable error message otherwise |
CURRENT_VERSION =
¶
Undocumented
Value |
|