exasol_sphinx_github_pages_generator.console module#

class exasol_sphinx_github_pages_generator.console.Console#

Bases: object

stderr(file: Optional[IO[Any]] = None, nl: bool = True, *, err: bool = True, color: Optional[bool] = None) None#

Print a message and newline to stdout or a file. This should be used instead of print() because it provides better support for different data, files, and environments.

Compared to print(), this does the following:

  • Ensures that the output encoding is not misconfigured on Linux.

  • Supports Unicode in the Windows console.

  • Supports writing to binary outputs, and supports writing bytes to text outputs.

  • Supports colors and styles on Windows.

  • Removes ANSI color and style codes if the output does not look like an interactive terminal.

  • Always flushes the output.

Parameters
  • message – The string or bytes to output. Other objects are converted to strings.

  • file – The file to write to. Defaults to stdout.

  • err – Write to stderr instead of stdout.

  • nl – Print a newline after the message. Enabled by default.

  • color – Force showing or hiding colors and other styles. By default Click will remove color if the output does not look like an interactive terminal.

Changed in version 6.0: Support Unicode output on the Windows console. Click does not modify sys.stdout, so sys.stdout.write() and print() will still not support Unicode.

Changed in version 4.0: Added the color parameter.

New in version 3.0: Added the err parameter.

Changed in version 2.0: Support colors on Windows if colorama is installed.

stdout(file: Optional[IO[Any]] = None, nl: bool = True, err: bool = False, color: Optional[bool] = None) None#

Print a message and newline to stdout or a file. This should be used instead of print() because it provides better support for different data, files, and environments.

Compared to print(), this does the following:

  • Ensures that the output encoding is not misconfigured on Linux.

  • Supports Unicode in the Windows console.

  • Supports writing to binary outputs, and supports writing bytes to text outputs.

  • Supports colors and styles on Windows.

  • Removes ANSI color and style codes if the output does not look like an interactive terminal.

  • Always flushes the output.

Parameters
  • message – The string or bytes to output. Other objects are converted to strings.

  • file – The file to write to. Defaults to stdout.

  • err – Write to stderr instead of stdout.

  • nl – Print a newline after the message. Enabled by default.

  • color – Force showing or hiding colors and other styles. By default Click will remove color if the output does not look like an interactive terminal.

Changed in version 6.0: Support Unicode output on the Windows console. Click does not modify sys.stdout, so sys.stdout.write() and print() will still not support Unicode.

Changed in version 4.0: Added the color parameter.

New in version 3.0: Added the err parameter.

Changed in version 2.0: Support colors on Windows if colorama is installed.