diff --git a/pywebio/output.py b/pywebio/output.py index 73f23d54..8a167fee 100644 --- a/pywebio/output.py +++ b/pywebio/output.py @@ -361,7 +361,8 @@ def _get_output_spec(type, scope, position, **other_spec): return spec -def put_text(*texts: Any, sep: str = ' ', inline: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_text(*texts: Any, sep: str = ' ', inline: bool = False, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """ Output plain text @@ -397,7 +398,8 @@ def _put_message(color, contents, closable=False, scope=None, position=OutputPos scope=scope, position=position).enable_context_manager() -def put_info(*contents: Any, closable: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_info(*contents: Any, closable: bool = False, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """Output information message. :param contents: Message contents. @@ -410,7 +412,8 @@ def put_info(*contents: Any, closable: bool = False, scope: str = None, position return _put_message(color='info', contents=contents, closable=closable, scope=scope, position=position) -def put_success(*contents: Any, closable: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_success(*contents: Any, closable: bool = False, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """Output success message. .. seealso:: `put_info()` .. versionadded:: 1.2 @@ -418,14 +421,16 @@ def put_success(*contents: Any, closable: bool = False, scope: str = None, posit return _put_message(color='success', contents=contents, closable=closable, scope=scope, position=position) -def put_warning(*contents: Any, closable: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_warning(*contents: Any, closable: bool = False, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """Output warning message. .. seealso:: `put_info()` """ return _put_message(color='warning', contents=contents, closable=closable, scope=scope, position=position) -def put_error(*contents: Any, closable: bool = False, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_error(*contents: Any, closable: bool = False, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """Output error message. .. seealso:: `put_info()` """ @@ -455,7 +460,8 @@ def put_html(html: Any, sanitize: bool = False, scope: str = None, position: int return Output(spec) -def put_code(content: str, language: str = '', rows: int = None, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_code(content: str, language: str = '', rows: int = None, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """ Output code block @@ -507,7 +513,8 @@ def _left_strip_multiple_line_string_literal(s): return '\n'.join(lines[:1] + lines_) -def put_markdown(mdcontent: str, lstrip: bool = True, options: Dict[str, Union[str, bool]] = None, sanitize: bool = True, +def put_markdown(mdcontent: str, lstrip: bool = True, options: Dict[str, Union[str, bool]] = None, + sanitize: bool = True, scope: str = None, position: int = OutputPosition.BOTTOM, **kwargs) -> Output: """ Output Markdown @@ -583,7 +590,8 @@ def span(content: Union[str, Output], row: int = 1, col: int = 1): @safely_destruct_output_when_exp('tdata') -def put_table(tdata: List[Union[List, Dict]], header: List[Union[str, Tuple[Any, str]]] = None, scope: str = None, position: int = OutputPosition.BOTTOM) -> Output: +def put_table(tdata: List[Union[List, Dict]], header: List[Union[str, Tuple[Any, str]]] = None, scope: str = None, + position: int = OutputPosition.BOTTOM) -> Output: """ Output table @@ -594,7 +602,7 @@ def put_table(tdata: List[Union[List, Dict]], header: List[Union[str, Tuple[Any, the first item of ``tdata`` will be used as the header. The header item can also use the :func:`span()` function to set the cell span. - When ``tdata`` is list of dict, ``header`` is used to specify the order of table headers, which cannot be omitted. + When ``tdata`` is list of dict, ``header`` can be used to specify the order of table headers. In this case, the ``header`` can be a list of dict key or a list of ``(