Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Version.Version Class Reference

Public Member Functions

None __init__ (self, Union[str, bytes, int, "Version", List[Union[int, str, bytes]]] version)
 
int getMajor (self)
 
int getMinor (self)
 
int getRevision (self)
 
str getPostfixType (self)
 
int getPostfixVersion (self)
 
"Version" getWithoutPostfix (self)
 
bool hasPostFix (self)
 
bool __gt__ (self, Union["Version", str] other)
 
bool __lt__ (self, Union["Version", str] other)
 
bool __eq__ (self, object other)
 
bool __ge__ (self, Union["Version", str] other)
 
bool __le__ (self, Union["Version", str] other)
 
str __str__ (self)
 
int __hash__ (self)
 

Protected Attributes

int _major = 0
 
int _minor = 0
 
int _revision = 0
 
str _postfix_type = ""
 
int _postfix_version = 0
 

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.

:param version: A 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.

:param other: Either 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.

:param other: Either 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.

:param other: Either another version object or a string representing one.

◆ __hash__()

int UM.Version.Version.__hash__ ( self)
Returns a number reasonably representing the identity of the version.

◆ __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.

:param other: Either 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.

:param other: Either 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".

◆ getWithoutPostfix()

"Version" UM.Version.Version.getWithoutPostfix ( self)
Returns this as _only_ a major.minor.revision, without the postfix type/version.

The postfix is everything beyond the patch, like '-beta+1' in 5.0.0-beta+1 -- in this example 5.0.0 is returned.

◆ hasPostFix()

bool UM.Version.Version.hasPostFix ( self)
Check if a version has a postfix.

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