Output hyperlinks to other web page or PyWebIO Application page. :param str name: The label of the link :param str url: Target url :param str app: Target PyWebIO Application name. See also: :ref:`Server mode ` :param bool new_window: Whether to open the link
(name: str, url: str = None, app: str = None, new_window: bool = False, scope: str = None,
position: int = OutputPosition.BOTTOM)
| 957 | |
| 958 | |
| 959 | def put_link(name: str, url: str = None, app: str = None, new_window: bool = False, scope: str = None, |
| 960 | position: int = OutputPosition.BOTTOM) -> Output: |
| 961 | """Output hyperlinks to other web page or PyWebIO Application page. |
| 962 | |
| 963 | :param str name: The label of the link |
| 964 | :param str url: Target url |
| 965 | :param str app: Target PyWebIO Application name. See also: :ref:`Server mode <server_and_script_mode>` |
| 966 | :param bool new_window: Whether to open the link in a new window |
| 967 | :param int scope, position: Those arguments have the same meaning as for `put_text()` |
| 968 | |
| 969 | The ``url`` and ``app`` parameters must specify one but not both |
| 970 | """ |
| 971 | assert bool(url is None) != bool(app is None), "Must set `url` or `app` parameter but not both" |
| 972 | |
| 973 | href = 'javascript:WebIO.openApp(%r, %d)' % (app, new_window) if app is not None else url |
| 974 | target = '_blank' if (new_window and url) else '_self' |
| 975 | tag = '<a href="{href}" target="{target}">{name}</a>'.format( |
| 976 | href=html.escape(href, quote=True), target=target, name=html.escape(name)) |
| 977 | return put_html(tag, scope=scope, position=position) |
| 978 | |
| 979 | |
| 980 | def put_progressbar(name: str, init: float = 0, label: str = None, auto_close: bool = False, scope: str = None, |
no test coverage detected
searching dependent graphs…