MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / _put_message

Function _put_message

pywebio/output.py:403–417  ·  view source on GitHub ↗
(color, contents, closable=False, scope=None, position=OutputPosition.BOTTOM)

Source from the content-addressed store, hash-verified

401
402
403def _put_message(color, contents, closable=False, scope=None, position=OutputPosition.BOTTOM) -> Output:
404 tpl = r"""
405<div class="alert alert-{{color}} {{#dismissible}}alert-dismissible fade show{{/dismissible}}" role="alert">
406{{#contents}}
407 {{& pywebio_output_parse}}
408{{/contents}}
409{{#dismissible}}
410<button type="button" class="close" data-dismiss="alert" aria-label="Close">
411<span aria-hidden="true">&times;</span>
412</button>
413{{/dismissible}}
414</div>""".strip()
415 contents = [c if isinstance(c, Output) else put_text(c) for c in contents]
416 return put_widget(template=tpl, data=dict(color=color, contents=contents, dismissible=closable),
417 scope=scope, position=position).enable_context_manager()
418
419
420def put_info(*contents: Any, closable: bool = False, scope: str = None,

Callers 4

put_infoFunction · 0.85
put_successFunction · 0.85
put_warningFunction · 0.85
put_errorFunction · 0.85

Calls 3

put_textFunction · 0.85
put_widgetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…