获取当前会话实现。仅供内部实现使用。应在会话上下文中调用 Get the current session implementation. For internal implementation use only. Should be called in session context
()
| 205 | |
| 206 | |
| 207 | def 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 | |
| 231 | def _start_script_mode_server(): |
no test coverage detected
searching dependent graphs…