def unjellyFor(self, unjellier, jellyList):
     if unjellier.invoker is None:
         return setInstanceState(self, unjellier, jellyList)
     self.broker = unjellier.invoker
     self.luid = jellyList[1]
     if isinstance(self.__class__, type):  #new-style class
         cProxy = _DummyNewStyle()
     else:
         cProxy = _Dummy()
     cProxy.__class__ = self.__class__
     cProxy.__dict__ = self.__dict__
     # XXX questionable whether this was a good design idea...
     init = getattr(cProxy, "__init__", None)
     if init:
         init()
     unjellier.invoker.cacheLocally(jellyList[1], self)
     cProxy.setCopyableState(unjellier.unjelly(jellyList[2]))
     # Might have changed due to setCopyableState method; we'll assume that
     # it's bad form to do so afterwards.
     self.__dict__ = cProxy.__dict__
     # chomp, chomp -- some existing code uses "self.__dict__ =", some uses
     # "__dict__.update".  This is here in order to handle both cases.
     self.broker = unjellier.invoker
     self.luid = jellyList[1]
     return cProxy
Example #2
0
def unjellyCached(unjellier, unjellyList):
    luid = unjellyList[1]
    cNotProxy = unjellier.invoker.cachedLocallyAs(luid)
    cProxy = _Dummy()
    cProxy.__class__ = cNotProxy.__class__
    cProxy.__dict__ = cNotProxy.__dict__
    return cProxy
 def unjellyFor(self, unjellier, jellyList):
     if unjellier.invoker is None:
         return setInstanceState(self, unjellier, jellyList)
     self.broker = unjellier.invoker
     self.luid = jellyList[1]
     if isinstance(self.__class__, type):  # new-style class
         cProxy = _DummyNewStyle()
     else:
         cProxy = _Dummy()
     cProxy.__class__ = self.__class__
     cProxy.__dict__ = self.__dict__
     # XXX questionable whether this was a good design idea...
     init = getattr(cProxy, "__init__", None)
     if init:
         init()
     unjellier.invoker.cacheLocally(jellyList[1], self)
     cProxy.setCopyableState(unjellier.unjelly(jellyList[2]))
     # Might have changed due to setCopyableState method; we'll assume that
     # it's bad form to do so afterwards.
     self.__dict__ = cProxy.__dict__
     # chomp, chomp -- some existing code uses "self.__dict__ =", some uses
     # "__dict__.update".  This is here in order to handle both cases.
     self.broker = unjellier.invoker
     self.luid = jellyList[1]
     return cProxy
def unjellyCached(unjellier, unjellyList):
    luid = unjellyList[1]
    cNotProxy = unjellier.invoker.cachedLocallyAs(luid)

    cProxy = _Dummy()
    cProxy.__class__ = cNotProxy.__class__
    cProxy.__dict__ = cNotProxy.__dict__
    return cProxy
Example #5
0
 def unjellyFor(self, unjellier, jellyList):
     if unjellier.invoker is None:
         return setInstanceState(self, unjellier, jellyList)
     self.broker = unjellier.invoker
     self.luid = jellyList[1]
     cProxy = _Dummy()
     cProxy.__class__ = self.__class__
     cProxy.__dict__ = self.__dict__
     init = getattr(cProxy, "__init__", None)
     if init:
         init()
     unjellier.invoker.cacheLocally(jellyList[1], self)
     cProxy.setCopyableState(unjellier.unjelly(jellyList[2]))
     self.__dict__ = cProxy.__dict__
     self.broker = unjellier.invoker
     self.luid = jellyList[1]
     return cProxy