rez.utils.colorize#

rez.utils.colorize.colorama_wrap(stream)#

Wrap the stream with colorama so that it can display colors on any OS

rez.utils.colorize.stream_is_tty(stream)#

Return true if the stream is a tty stream.

Returns:

bool

rez.utils.colorize.critical(str_)#

Return the string wrapped with the appropriate styling of a critical message. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.error(str_)#

Return the string wrapped with the appropriate styling of an error message. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.warning(str_)#

Return the string wrapped with the appropriate styling of a warning message. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.info(str_)#

Return the string wrapped with the appropriate styling of an info message. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.debug(str_)#

Return the string wrapped with the appropriate styling of a debug message. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.heading(str_)#

Return the string wrapped with the appropriate styling of a heading message. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.local(str_)#

Return the string wrapped with the appropriate styling to display a local package. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.implicit(str_)#

Return the string wrapped with the appropriate styling to display an implicit package. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.ephemeral(str_)#

Return the string wrapped with the appropriate styling to display an ephemeral package. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.alias(str_)#

Return the string wrapped with the appropriate styling to display a tool alias. The styling will be determined based on the rez configuration.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

rez.utils.colorize.inactive(str_)#

Return the string wrapped with the appropriate styling to display something inactive.

Choices are grey, grey or grey.

rez.utils.colorize.notset(str_)#

Return the string wrapped with the appropriate escape sequences to remove all styling.

Parameters:

str (str) – The string to be wrapped.

Returns:

The string styled with the appropriate escape sequences.

Return type:

str

class rez.utils.colorize.ColorizedStreamHandler#

A stream handler for use with the Python logger.

This handler uses the Colorama module to style the log messages based on the rez configuration.

STYLES#

A mapping between the Python logger levels and a function that can be used to provide the appropriate styling.

Type:

dict

__init__(stream=None)#

Initialize the handler.

If stream is not specified, sys.stderr is used.

property is_tty#

Return true if the stream associated with this handler is a tty stream.

Returns:

bool

emit(record)#

Emit a record.

If the stream associated with this handler provides tty then the record that is emitted with be formatted to include escape sequences for appropriate styling.