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

Method insert

pywebio/output.py:1882–1893  ·  view source on GitHub ↗

idx可为负 idx can be negative

(self, idx, *outputs)

Source from the content-addressed store, hash-verified

1880
1881 @safely_destruct_output_when_exp('outputs')
1882 def insert(self, idx, *outputs):
1883 """
1884 idx可为负
1885 idx can be negative
1886 """
1887 direction = 1 if idx >= 0 else -1
1888 for acc, o in enumerate(outputs):
1889 if not isinstance(o, Output):
1890 o = put_text(o)
1891 o.spec['scope'] = scope2dom(self.scope)
1892 o.spec['position'] = idx + direction * acc
1893 o.send()
1894
1895 contents = [c if isinstance(c, Output) else put_text(c) for c in contents]
1896

Callers 6

basic_outputFunction · 0.80
conf.pyFile · 0.80
IiFunction · 0.80
cFunction · 0.80
cFunction · 0.80
wsgi_appFunction · 0.80

Calls 3

put_textFunction · 0.85
scope2domFunction · 0.85
sendMethod · 0.80

Tested by

no test coverage detected