Jump to >

rbtools.utils.checks

Functions

check_gnu_diff()

Check if GNU diff is installed, and informs the user if it's not.

check_install(command)

Check if the given command is installed.

is_valid_version(actual, expected)

Return whether one tuple is greater than or equal to another.

rbtools.utils.checks.check_install(command)[source]

Check if the given command is installed.

Try executing an external command and return a boolean indicating whether that command is installed or not. The ‘command’ argument should be something that executes quickly, without hitting the network (for instance, ‘svn help’ or ‘git –version’).

rbtools.utils.checks.check_gnu_diff()[source]

Check if GNU diff is installed, and informs the user if it’s not.

Deprecated since version 4.0: Clients should use Diff Tools (see rbtools.diffs.tools) instead.

This will be removed in 5.0.

Raises:

Exception – GNU diff is not installed.

rbtools.utils.checks.is_valid_version(actual, expected)[source]

Return whether one tuple is greater than or equal to another.

Tuples should be in the form of:

(major_version, minor_version, micro_version)

With each version an integer.

Deprecated since version 4.0: Consumers should just compare tuples directly. This will be removed in RBTools 5.0.

Parameters:
  • actual (tuple of int) – The actual version to compare.

  • expected (tuple of int) – The expected version to compare against.

Returns:

True if actual is greater than or equal to the expected version. False otherwise.

Return type:

bool