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

Function get_session_implement

pywebio/session/__init__.py:207–228  ·  view source on GitHub ↗

获取当前会话实现。仅供内部实现使用。应在会话上下文中调用 Get the current session implementation. For internal implementation use only. Should be called in session context

()

Source from the content-addressed store, hash-verified

205
206
207def get_session_implement():
208 """获取当前会话实现。仅供内部实现使用。应在会话上下文中调用
209 Get the current session implementation. For internal implementation use only. Should be called in session context"""
210 if not _active_session_cls:
211 _active_session_cls.append(ScriptModeSession)
212 _start_script_mode_server()
213
214 # 当前正在使用的会话实现只有一个
215 # There is only one session implementation currently in use
216 if len(_active_session_cls) == 1:
217 return _active_session_cls[0]
218
219 # 当前有多个正在使用的会话实现
220 # There are currently multiple session implementations in use
221 for cls in _active_session_cls:
222 try:
223 cls.get_current_session()
224 return cls
225 except SessionNotFoundException:
226 pass
227
228 raise SessionNotFoundException
229
230
231def _start_script_mode_server():

Callers 3

get_current_sessionFunction · 0.85
get_current_task_idFunction · 0.85
innerFunction · 0.85

Calls 3

appendMethod · 0.80
get_current_sessionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…