Internal documentation

universum.modules.output.base_output

class BaseOutput(main_settings: HasModulesMapping, *args, **kwargs)[source]

Abstract base class for output drivers. Defines methods that have to be implemented by each module that implements a type of output.

log_execution_start(title: str, version: str) None[source]

Print the universum startup message, for example: “==> Universum xx.yy.zz started execution”

Parameters:
  • title – name of the product

  • version – version of the product

log_execution_finish(title: str, version: str) None[source]

Print the universum finished message, for example: “==> Universum xx.yy.zz finished execution”

Parameters:
  • title – name of the product

  • version – version of the product

log(line: str) None[source]

Print a line to the output. The most generic type of log. Mostly used for printing own messages of universum.

Parameters:

line – the line to print

log_error(description: str) None[source]

Print an error message to the output. Error may use different colors or other formatting. Used for printing own error messages of the universum as well as error messages from other modules and libraries and operating system.

Parameters:

description – the detailed error message

log_external_command(command: str) None[source]

Print the start of the launch of the external command. Full command line with all arameters is supposed to be printed.

Parameters:

command – external command with parameters

log_stdout(line: str) None[source]

Print one line of the standard output of the previously launched external command. The only usage is for printing output of the commands that are launched during the execution of the universum config.

Parameters:

line – the line to print

log_stderr(line: str) None[source]

Print one line of the standard error output of the previously launched external command. The only usage is for printing standard error output of the commands that are launched during the execution of the universum config.

Parameters:

line – the line to print

open_block(num_str: str, name: str) None[source]

Start the block of the output. Block is a group of related output lines. Depending on the capabilities of the output, the blocks can be marked by indentation, color or numbering. Output can also implement dynamic blocks collapsing and expanding.

Parameters:
  • num_str – the string that represents the block number within the hierarchy. Inner blocks are numbered using dot notation. The number string is passed as a separate parameter to allow implementing different formatting for number and name.

  • name – the title of the block.

close_block(num_str: str, name: str, status: str) None[source]

End the block of the output.

Parameters:
  • num_str – the string that represents the block number

  • name – the title of the block

  • status – the completion status of the block: “Passed” or “Failed”

log_skipped(message: str) None[source]

Print a message related to skipping steps. It could be a warning that further steps are skipped, or a message that the step is skipped.

Parameters:

message – the message to print

log_summary_step(step_title: str, has_children: bool, status: str) None[source]

Print a summary of the step execution at the end of the run.

Parameters:
  • step_title – the title of the step

  • has_children – whether the step has children or not. Typically, if step has children, the status is not included in the summary.

  • status – the status of the step: “Passed”, “Failed” or “Skipped”

report_build_problem(description: str) None[source]

TeamCity only. Report run problem to the TeamCity via the output. Also fails the build regardless of the process exit code. Multiple build problems for single run can be reported.

Parameters:

description – the description of the problem

set_build_status(status: str) None[source]

TeamCity only. Set the title of the build. Changes the status of the build visible in the configuration build history and on the build page itself. For builds containing build problems, by default the status is automatically populated with them by the TeamCity server itself. This method allows to override the status.

Parameters:

status – the status (title) of the build