Skip to content
Myr

Added secho

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent e6599a3 · Browse files · 4 files+27 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+27 added−2 removed

  • other:+27 added−2 removed

4 files+27 added−2 removed

modified:click/__init__.py+2 added-2 removed
31 unmodified lines
32 format_filename, get_app_dir3334# Terminal functions35from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \36 progressbar, clear, style, unstyle36 progressbar, clear, style, unstyle, secho3738# Exceptions39from .exceptions import ClickException, UsageError, BadParameter, \40 FileError, Abort
24 unmodified lines
65 'get_app_dir',6667 # Terminal functions68 'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager',69 'progressbar', 'clear', 'style', 'unstyle',69 'progressbar', 'clear', 'style', 'unstyle', 'secho',7071 # Exceptions72 'ClickException', 'UsageError', 'BadParameter', 'FileError',73 'Abort',
10 unmodified lines
modified:click/termui.py+16 added
351 unmodified lines
352353 :param text: the text to remove style information from.354 """355 return strip_ansi(text)356357358def secho(text, file=None, nl=True, **styles):359 """This function combines :func:`echo` and :func:`style` into one360 call. As such the following two calls are the same::361362 click.secho('Hello World!', fg='green')363 click.echo(click.style('Hello World!', fg='green'))364365 All keyword arguments are forwarded to the underlying functions366 depending on which one they go with.367368 .. versionadded:: 2.0369 """370 text = style(text, **styles)371 return echo(text, file=file, nl=nl)
modified:docs/api.rst+2 added
48 unmodified lines
49.. autofunction:: style5051.. autofunction:: unstyle5253.. autofunction:: secho5455.. autofunction:: format_filename5657.. autofunction:: get_terminal_size58
101 unmodified lines
modified:docs/utils.rst+7 added
65 unmodified lines
66 click.echo(click.style('Hello World!', fg='green'))67 click.echo(click.style('Some more text', bg='blue', fg='white'))68 click.echo(click.style('ATTENTION', blink=True))6970The combination of :func:`echo` and :func:`style` is also available in71a single function called :func:`secho`::7273 click.secho('Hello World!', fg='green')74 click.secho('Some more text', bg='blue', fg='white')75 click.secho('ATTENTION', blink=True)767778.. _colorama: https://pypi.python.org/pypi/colorama798081Screen Clearing
131 unmodified lines