MCPcopy Index your code
hub / github.com/python/cpython / FrameProxy

Class FrameProxy

Lib/idlelib/debugger_r.py:198–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196
197
198class FrameProxy:
199
200 def __init__(self, conn, fid):
201 self._conn = conn
202 self._fid = fid
203 self._oid = "idb_adapter"
204 self._dictcache = {}
205
206 def __getattr__(self, name):
207 if name[:1] == "_":
208 raise AttributeError(name)
209 if name == "f_code":
210 return self._get_f_code()
211 if name == "f_globals":
212 return self._get_f_globals()
213 if name == "f_locals":
214 return self._get_f_locals()
215 return self._conn.remotecall(self._oid, "frame_attr",
216 (self._fid, name), {})
217
218 def _get_f_code(self):
219 cid = self._conn.remotecall(self._oid, "frame_code", (self._fid,), {})
220 return CodeProxy(self._conn, self._oid, cid)
221
222 def _get_f_globals(self):
223 did = self._conn.remotecall(self._oid, "frame_globals",
224 (self._fid,), {})
225 return self._get_dict_proxy(did)
226
227 def _get_f_locals(self):
228 did = self._conn.remotecall(self._oid, "frame_locals",
229 (self._fid,), {})
230 return self._get_dict_proxy(did)
231
232 def _get_dict_proxy(self, did):
233 if did in self._dictcache:
234 return self._dictcache[did]
235 dp = DictProxy(self._conn, self._oid, did)
236 self._dictcache[did] = dp
237 return dp
238
239
240class CodeProxy:

Callers 2

interactionMethod · 0.85
get_stackMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…