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

Method __enter__

pywebio/io_ctrl.py:95–104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 return self
94
95 def __enter__(self):
96 if not self.enabled_context_manager:
97 raise RuntimeError("This output function can't be used as context manager!")
98
99 self.container_dom_id = self.container_dom_id or random_str(10)
100 self.spec['container_selector'] = self.container_selector
101 self.spec['container_dom_id'] = scope2dom(self.container_dom_id, no_css_selector=True)
102 self.send()
103 get_current_session().push_scope(self.container_dom_id)
104 return self.container_dom_id
105
106 def __exit__(self, exc_type, exc_val, exc_tb):
107 """

Callers

nothing calls this directly

Calls 5

sendMethod · 0.95
random_strFunction · 0.85
scope2domFunction · 0.85
get_current_sessionFunction · 0.85
push_scopeMethod · 0.80

Tested by

no test coverage detected