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

Class RPCProxy

Lib/idlelib/rpc.py:550–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548
549
550class RPCProxy:
551
552 __methods = None
553 __attributes = None
554
555 def __init__(self, sockio, oid):
556 self.sockio = sockio
557 self.oid = oid
558
559 def __getattr__(self, name):
560 if self.__methods is None:
561 self.__getmethods()
562 if self.__methods.get(name):
563 return MethodProxy(self.sockio, self.oid, name)
564 if self.__attributes is None:
565 self.__getattributes()
566 if name in self.__attributes:
567 value = self.sockio.remotecall(self.oid, '__getattribute__',
568 (name,), {})
569 return value
570 else:
571 raise AttributeError(name)
572
573 def __getattributes(self):
574 self.__attributes = self.sockio.remotecall(self.oid,
575 "__attributes__", (), {})
576
577 def __getmethods(self):
578 self.__methods = self.sockio.remotecall(self.oid,
579 "__methods__", (), {})
580
581def _getmethods(obj, methods):
582 # Helper to get a list of methods from an object

Callers 3

_proxifyMethod · 0.85
get_remote_proxyMethod · 0.85
get_remote_proxyMethod · 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…