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

Method get_scope_name

pywebio/session/base.py:68–78  ·  view source on GitHub ↗

获取当前任务的scope栈检索scope名 :param int idx: scope栈的索引 :return: scope名,不存在时返回 None

(self, idx)

Source from the content-addressed store, hash-verified

66 self._closed = False
67
68 def get_scope_name(self, idx):
69 """获取当前任务的scope栈检索scope名
70
71 :param int idx: scope栈的索引
72 :return: scope名,不存在时返回 None
73 """
74 task_id = type(self).get_current_task_id()
75 try:
76 return self.scope_stack[task_id][idx]
77 except IndexError:
78 raise ValueError("Scope not found")
79
80 def pop_scope(self):
81 """弹出当前scope

Callers 1

get_scopeFunction · 0.80

Calls 1

get_current_task_idMethod · 0.45

Tested by

no test coverage detected