Uranium
Application Framework
UM.Version.Version Class Reference

Represents a version number, like "3.2.8" and allows comparison of those numbers. More...

Public Member Functions

None __init__ (self, Union[str, bytes, int, "Version", List[Union[int, str, bytes]]] version)
 Constructs the version instance from a string representing the version. More...
 
int getMajor (self)
 Gets the major version number. More...
 
int getMinor (self)
 Gets the minor version number. More...
 
int getRevision (self)
 Gets the revision or patch version number. More...
 
str getPostfixType (self)
 Gets the postfix type. More...
 
int getPostfixVersion (self)
 Gets the postfix version number. More...
 
bool hasPostFix (self)
 Check if a version has a postfix.
 
bool __gt__ (self, Union["Version", str] other)
 Indicates whether this version is later than the specified version. More...
 
bool __lt__ (self, Union["Version", str] other)
 Indicates whether this version is earlier than the specified version. More...
 
bool __eq__ (self, object other)
 Indicates whether this version is equal to the specified version. More...
 
bool __ge__ (self, Union["Version", str] other)
 Indicates whether this version is later or equal to the specified version. More...
 
bool __le__ (self, Union["Version", str] other)
 Indicates whether this version is earlier or equal to the specified version. More...
 
str __str__ (self)
 Returns a string representation containing the major, minor and revision number. More...
 
int __hash__ (self)
 Returns a number reasonably representing the identity of the version.
 

Detailed Description

Represents a version number, like "3.2.8" and allows comparison of those numbers.

Constructor & Destructor Documentation

◆ __init__()

None UM.Version.Version.__init__ (   self,
Union[str, bytes, int, "Version", List[Union[int, str, bytes]]]  version 
)

Constructs the version instance from a string representing the version.

The string representation may have dashes or underscores that separate the major, minor and revision version numbers. All text is ignored.

Parameters
versionA string or bytes representing a version number.

Member Function Documentation

◆ __eq__()

bool UM.Version.Version.__eq__ (   self,
object  other 
)

Indicates whether this version is equal to the specified version.

Implements the == operator.

Parameters
otherEither another version object or a string representing one.

◆ __ge__()

bool UM.Version.Version.__ge__ (   self,
Union["Version", str]  other 
)

Indicates whether this version is later or equal to the specified version.

Implements the >= operator.

Parameters
otherEither another version object or a string representing one.

◆ __gt__()

bool UM.Version.Version.__gt__ (   self,
Union["Version", str]  other 
)

Indicates whether this version is later than the specified version.

Implements the > operator.

Parameters
otherEither another version object or a string representing one.

◆ __le__()

bool UM.Version.Version.__le__ (   self,
Union["Version", str]  other 
)

Indicates whether this version is earlier or equal to the specified version.

Implements the <= operator.

Parameters
otherEither another version object or a string representing one.

◆ __lt__()

bool UM.Version.Version.__lt__ (   self,
Union["Version", str]  other 
)

Indicates whether this version is earlier than the specified version.

Implements the < operator.

Parameters
otherEither another version object or a string representing one.

◆ __str__()

str UM.Version.Version.__str__ (   self)

Returns a string representation containing the major, minor and revision number.

Such as "3.2.8".

◆ getMajor()

int UM.Version.Version.getMajor (   self)

Gets the major version number.

The major version number is the first number of the version: "3" in the version "3.2.8".

◆ getMinor()

int UM.Version.Version.getMinor (   self)

Gets the minor version number.

The minor version number is the second number of the version: "2" in the version "3.2.8".

◆ getPostfixType()

str UM.Version.Version.getPostfixType (   self)

Gets the postfix type.

The postfix type is the name of the postfix, e.g. "alpha" in the version "1.2.3-alpha.4"

◆ getPostfixVersion()

int UM.Version.Version.getPostfixVersion (   self)

Gets the postfix version number.

The postfix version is the last number, e.g. "4" in the version "1.2.3-alpha.4"

◆ getRevision()

int UM.Version.Version.getRevision (   self)

Gets the revision or patch version number.

The revision version number is the third number of the version: "8" in the version "3.2.8".


The documentation for this class was generated from the following file: