management.util.output_wrapper

Output wrapper for Django management commands.

Provides an adapter between Django’s CommandStyle and our OutputWriter protocol.

Classes

CommandOutputWrapper

Adapter for Django command output to match OutputWriter protocol.

Module Contents

class management.util.output_wrapper.CommandOutputWrapper(stdout, style)[source]

Adapter for Django command output to match OutputWriter protocol.

Parameters:
  • stdout (django.core.management.base.OutputWrapper)

  • style (django.core.management.color.Style)

_stdout[source]
_style[source]
write(msg)[source]

Write a message to stdout.

Parameters:

msg (str) – The message to write.

Return type:

None

success(msg)[source]

Format a success message with styling.

Parameters:

msg (str) – The message to format.

Returns:

The styled message.

Return type:

str

error(msg)[source]

Format an error message with styling.

Parameters:

msg (str) – The message to format.

Returns:

The styled message.

Return type:

str

warning(msg)[source]

Format a warning message with styling.

Parameters:

msg (str) – The message to format.

Returns:

The styled message.

Return type:

str