| 196 | |
| 197 | |
| 198 | class 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 | |
| 240 | class CodeProxy: |
no outgoing calls
no test coverage detected
searching dependent graphs…