colour.utilities.verbose Module

Verbose

Defines verbose related objects.

colour.utilities.verbose.message_box(message, width=79, padding=3)[source]

Prints a message inside a box.

Parameters:
  • message (unicode) – Message to print.
  • width (int, optional) – Message box width.
  • padding (unicode) – Padding on each sides of the message.
Returns:

Definition success.

Return type:

bool

Examples

>>> message = ('Lorem ipsum dolor sit amet, consectetur adipiscing elit, '
...     'sed do eiusmod tempor incididunt ut labore et dolore magna '
...     'aliqua.')
>>> message_box(message, width=75)
===========================================================================
*                                                                         *
*   Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do       *
*   eiusmod tempor incididunt ut labore et dolore magna aliqua.           *
*                                                                         *
===========================================================================
True
>>> message_box(message, width=60)
============================================================
*                                                          *
*   Lorem ipsum dolor sit amet, consectetur adipiscing     *
*   elit, sed do eiusmod tempor incididunt ut labore et    *
*   dolore magna aliqua.                                   *
*                                                          *
============================================================
True
>>> message_box(message, width=75, padding=16)
===========================================================================
*                                                                         *
*                Lorem ipsum dolor sit amet, consectetur                  *
*                adipiscing elit, sed do eiusmod tempor                   *
*                incididunt ut labore et dolore magna                     *
*                aliqua.                                                  *
*                                                                         *
===========================================================================
True
colour.utilities.verbose.warning(*args, **kwargs)[source]

Issues a warning.

Parameters:
  • *args (*) – Arguments.
  • **kwargs (**) – Keywords arguments.
Returns:

Definition success.

Return type:

bool

Examples

>>> colour.utilities.warning('This is a warning!')  
/Users/.../colour/utilities/verbose.py:42: UserWarning: This is a warning!