wx.VersionInfo¶
wx.VersionInfo contains version information.
This class is used by wxWidgets to provide version information about the libraries it uses and itself, but you can also apply it in user space, to provide version information about your own libraries, or other libraries that you use.
For example, if you are including Lua in your program, you can gather its library info as such:
Added in version 2.9.2.
Class Hierarchy¶
Methods Summary¶
Constructor. |
|
Return |
|
Get the copyright string. |
|
Get the description string. |
|
Get the major version number. |
|
Get the micro version, or release number. |
|
Get the minor version number. |
|
Get the name of the object (library). |
|
Get the string representation of only numeric version components. |
|
Get the revision version, or build number. |
|
Get the string representation. |
|
Returns |
|
Return |
|
Return |
|
Get the string representation of this version object. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.VersionInfo(object)¶
Possible constructors:
VersionInfo(name="", major=0, minor=0, micro=0, revision=0, description="", copyright="") -> None
VersionInfo contains version information.
Methods¶
- __init__(self, name='', major=0, minor=0, micro=0, revision=0, description='', copyright='')¶
Constructor.
The version information objects need to be initialized with this constructor and are immutable once they are created.
- Parameters:
name (string) – The name of the library or other entity that this object pertains to.
major (int) – The major version component.
minor (int) – The minor version component.
micro (int) – The micro version component, 0 by default.
revision (int) – The revision version component, also known as “build number”. This component is also 0 by default and is only available since wxWidgets 3.2.0.
description (string) – Free form description of this version, none by default.
copyright (string) – Copyright string, none by default.
- Return type:
None
- AtLeast(self, major, minor=0, micro=0)¶
Return
Trueif the version is at least equal to the given one.- Parameters:
major (int) – Major version to compare with.
minor (int) – Optional minor version to compare with.
micro (int) – Optional micro version to compare with.
- Return type:
bool
- Returns:
Trueif this version is equal to or greater than the given one.
Added in version 4.3/wxWidgets-3.3.0.
- GetCopyright(self)¶
Get the copyright string.
The copyright string may be empty.
- Return type:
str
- Returns:
The copyright string.
- GetDescription(self)¶
Get the description string.
The description may be empty.
- Return type:
str
- Returns:
The description string, free-form.
- GetMajor(self)¶
Get the major version number.
- Return type:
int
- Returns:
Major version number.
- GetMicro(self)¶
Get the micro version, or release number.
This is the third component of the version.
- Return type:
int
- Returns:
Micro version, or release number.
- GetMinor(self)¶
Get the minor version number.
- Return type:
int
- Returns:
Minor version number.
- GetName(self)¶
Get the name of the object (library).
- Return type:
str
- Returns:
Name string.
- GetNumericVersionString(self)¶
Get the string representation of only numeric version components.
The micro and revision components of the version are ignored/not used if they are both zero. If the revision component is non-zero all four parts will be used even if the micro component is zero.
- Return type:
str
- Returns:
The version string in the form “major.minor[.micro[.revision]]”.
Added in version 4.3/wxWidgets-3.3.0.
- GetRevision(self)¶
Get the revision version, or build number.
This is the fourth component of the version.
- Return type:
int
- Returns:
Revision version, or build number.
Added in version 4.2/wxWidgets-3.2.0.
- GetVersionString(self)¶
Get the string representation.
The micro and revision components of the version are ignored/not used if they are both zero. If the revision component is non-zero all four parts will be used even if the micro component is zero.
Note that this function includes the name of the object this version is defined for, if this is undesired, use
GetNumericVersionStringinstead.- Return type:
str
- Returns:
The version string in the form “name major.minor[.micro[.revision]]”.
- HasCopyright(self)¶
Returns
Trueif a copyright string has been specified.- Return type:
bool
See also
- HasDescription(self)¶
Return
Trueif a description string has been specified.- Return type:
bool
See also
- IsOk(self)¶
Return
Trueif there is actually at least some version information.For the default-constructed object, this function returns
False, allowing to distinguish it from any object filled with the version information.- Return type:
bool
Added in version 4.3/wxWidgets-3.3.0.
- ToString(self)¶
Get the string representation of this version object.
This function returns the description if it is non-empty or
GetVersionStringif there is no description.- Return type:
str
See also
Properties¶
- Copyright¶
See
GetCopyright
- Description¶
See
GetDescription
- NumericVersionString¶
- Revision¶
See
GetRevision
- VersionString¶
See
GetVersionString