VersionInfo

class mobase.VersionInfo(**kwds)

Bases: object

Represents the version of a mod or plugin.

Methods Summary

canonicalString()

returns

A canonical string representing this version, that can be stored and then parsed using the parse() method.

clear()

Resets this VersionInfo to an invalid version.

displayString([forced_segments])

param forced_segments

The number of version segments to display even if the version is 0. 1 is major, 2 is major

isValid()

returns

True if this VersionInfo is valid, False otherwise.

parse(value[, scheme, manual_input])

Update this VersionInfo by parsing the given string using the given scheme.

scheme()

returns

The version scheme in effect for this VersionInfo.

Methods Documentation

canonicalString()
Returns

A canonical string representing this version, that can be stored and then parsed using the parse() method.

Return type

str

clear()

Resets this VersionInfo to an invalid version.

displayString(forced_segments=2)
Parameters

forced_segments – The number of version segments to display even if the version is 0. 1 is major, 2 is major and minor, etc. The only implemented ranges are (-inf,2] for major/minor, [3] for major/minor/subminor, and [4,inf) for major/minor/subminor/subsubminor. This only versions with a regular scheme.

Returns

A string for display to the user. The returned string may not contain enough information to reconstruct this version info.

Return type

str

isValid()
Returns

True if this VersionInfo is valid, False otherwise.

Return type

bool

parse(value, scheme=<VersionScheme.DISCOVER: Ellipsis>, manual_input=False)

Update this VersionInfo by parsing the given string using the given scheme.

Parameters
  • value – String to parse.

  • scheme – Scheme to use to parse the string.

  • manual_input – True if the given string should be treated as user input.

scheme()
Returns

The version scheme in effect for this VersionInfo.

Return type

VersionScheme