Skip to content
Myr

Merge branch 'her0e1c1-fix-secho'

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

Fix #424

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents cdea8fc, 70f29dc · Browse files · 3 files+12 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

3 files+12 added−2 removed

  • tests:+7 added−0 removed
  • other:+5 added−2 removed

3 files+12 added−2 removed

modified:click/termui.py+4 added-2 removed
403 unmodified lines
404 """405 return strip_ansi(text)406407408def secho(text, file=None, nl=True, err=False, color=None, **styles):408def secho(message=None, file=None, nl=True, err=False, color=None, **styles):409 """This function combines :func:`echo` and :func:`style` into one410 call. As such the following two calls are the same::411412 click.secho('Hello World!', fg='green')
3 unmodified lines
416 depending on which one they go with.417418 .. versionadded:: 2.0419 """420 if message is not None:421 message = style(message, **styles)420 return echo(style(text, **styles), file=file, nl=nl, err=err, color=color)422 return echo(message, file=file, nl=nl, err=err, color=color)423424425def edit(text=None, editor=None, env=None, require_save=True,426 extension='.txt', filename=None):
115 unmodified lines
modified:tests/test_termui.py+7 added
40 unmodified lines
4142 monkeypatch.setattr(click._termui_impl, 'isatty', lambda _: True)43 result = runner.invoke(cli, [])44 assert result.exception is None454647def test_secho(runner):48 with runner.isolation() as out:49 click.secho(None, nl=False)50 bytes = out.getvalue()51 assert bytes == b''
modified:CHANGES+1 added
9 unmodified lines
1011- The exception objects now store unicode properly.12- Added the ability to hide commands and options from help.13- Added Float Range in Types.14- `secho`'s first argument can now be `None`, like in `echo`.1516Version 6.517-----------18
331 unmodified lines