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

Function _set_options_selected

pywebio/input.py:331–338  ·  view source on GitHub ↗

set `selected` attribute for `options`

(options, value)

Source from the content-addressed store, hash-verified

329
330
331def _set_options_selected(options, value):
332 """set `selected` attribute for `options`"""
333 if not isinstance(value, (list, tuple)):
334 value = [value]
335 for opt in options:
336 if opt['value'] in value:
337 opt['selected'] = True
338 return options
339
340
341def select(label: str = '', options: List[Union[Dict[str, Any], Tuple, List, str]] = None, *, multiple: bool = None,

Callers 3

selectFunction · 0.85
checkboxFunction · 0.85
radioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…