Package zeroinstall :: Package injector :: Module versions
[frames] | no frames]

Module versions

source code

Functions for processing version numbers.


Since: 1.13

Functions
tuple (opaque)
parse_version(version_string)
Convert a version string to an internal representation.
source code
str
format_version(version)
Format a parsed version for display.
source code
parsed_version -> bool
parse_version_range(r)
Parse a range expression.
source code
parsed_version -> bool
parse_version_expression(expr)
Parse an expression of the form "RANGE | RANGE | ...".
source code
Function Details

parse_version(version_string)

source code 

Convert a version string to an internal representation. The parsed format can be compared quickly using the standard Python functions.

  • Version := DottedList ("-" Mod DottedList?)*
  • DottedList := (Integer ("." Integer)*)
Parameters:
  • version_string (str)
Returns: tuple (opaque)
Raises:

Since: 0.24 (moved from reader, from where it is still available):

format_version(version)

source code 

Format a parsed version for display. Undoes the effect of parse_version.

Returns: str

See Also: model.Implementation.get_version

Since: 0.24

parse_version_range(r)

source code 

Parse a range expression.

Parameters:
  • r (str) - the range expression
Returns: parsed_version -> bool
a function which returns whether a parsed version is in the range

Since: 1.13

parse_version_expression(expr)

source code 

Parse an expression of the form "RANGE | RANGE | ...".

Parameters:
  • expr (str) - the expression to parse
Returns: parsed_version -> bool
a function which tests whether a parsed version is in the range

Since: 1.13