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

Function put_link

pywebio/output.py:959–977  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

957
958
959def 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
980def put_progressbar(name: str, init: float = 0, label: str = None, auto_close: bool = False, scope: str = None,

Callers 3

targetFunction · 0.85
basic_outputFunction · 0.85
output_widgetsFunction · 0.85

Calls 1

put_htmlFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…