4.1.4.5. RevisionVersion

This module provides tools for software versionning.

class PyOpenGLng.Tools.RevisionVersion.RevisionVersion(version)[source]

Bases: object

This class implements a revision version of the form vx.y.z-suffix where x, y and z are the major, minor and revision number, respectively.

The version numbers can be accessed via the attributes major, minor, revision, suffix.

The version string can be formated using str() function.

Two instances can be compared using these operators: ==, <, >, <=, >=. To compare two versions, the version numbering (x, y, z) is converted to an integer in a pre-defined base using the following formulae: (x * base + y) * base + z. Thus x, y and z must be less than the base.

The parameter version could be a version string, an iterable or a dictionnary. The suffix is optional.

Examples:

RevisionVersion('v0.1.2')
RevisionVersion('v0.1.2-r123')
RevisionVersion((0,1,2))
RevisionVersion((0,1,2,'r123'))
RevisionVersion({'major':0, 'minor':1, 'revision':2, suffix:'r123'})
base = 1000

Base

clone()[source]
to_tuple()[source]

Return the tuple (major, minor, revision, suffix)

version_string()[source]

Format the version as vx.y.z

Previous topic

4.1.4.4. Math

Next topic

4.1.4.6. Singleton

This Page