MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / _get_output_spec

Function _get_output_spec

pywebio/output.py:356–380  ·  view source on GitHub ↗

get the spec dict of output functions :param str type: output type :param str scope: target scope :param int position: :param other_spec: Additional output parameters, the None value will not be included in the return value :return dict: ``spec`` field of ``output`` comman

(type, scope, position, **other_spec)

Source from the content-addressed store, hash-verified

354
355
356def _get_output_spec(type, scope, position, **other_spec):
357 """
358 get the spec dict of output functions
359
360 :param str type: output type
361 :param str scope: target scope
362 :param int position:
363 :param other_spec: Additional output parameters, the None value will not be included in the return value
364
365 :return dict: ``spec`` field of ``output`` command
366 """
367 spec = dict(type=type)
368
369 # add non-None arguments to spec
370 spec.update({k: v for k, v in other_spec.items() if v is not None})
371
372 if not scope:
373 scope_name = get_scope()
374 else:
375 scope_name = scope
376
377 spec['scope'] = scope2dom(scope_name)
378 spec['position'] = position
379
380 return spec
381
382
383def put_text(*texts: Any, sep: str = ' ', inline: bool = False, scope: str = None,

Callers 11

_pin_outputFunction · 0.90
put_textFunction · 0.85
put_htmlFunction · 0.85
put_markdownFunction · 0.85
put_tableFunction · 0.85
put_buttonsFunction · 0.85
put_scrollableFunction · 0.85
put_tabsFunction · 0.85
put_widgetFunction · 0.85
put_scopeFunction · 0.85
put_datatableFunction · 0.85

Calls 2

get_scopeFunction · 0.85
scope2domFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…