Beispiel #1
0
 def __init__(self, wrappee):
     for name, value in inspect.getmembers(wrappee):
         if not hasattr(self, name):
             try:
                 setattr(self, name, pickle.loads(pickle.dumps(value)))
             except TypeError:
                 pass
Beispiel #2
0
def obtain(proxy):
    """obtains (copies) a remote object from a proxy object. the object is 
    ``pickled`` on the remote side and ``unpickled`` locally, thus moved 
    **by value**. changes made to the local object will not reflect remotely.
        
    :param proxy: an RPyC proxy object
    
    .. note:: the remote object to must be ``pickle``-able

    :returns: a copy of the remote object
    """
    return pickle.loads(pickle.dumps(proxy))
Beispiel #3
0
def obtain(proxy):
    """obtains (copies) a remote object from a proxy object. the object is 
    ``pickled`` on the remote side and ``unpickled`` locally, thus moved 
    **by value**. changes made to the local object will not reflect remotely.
        
    :param proxy: an RPyC proxy object
    
    .. note:: the remote object to must be ``pickle``-able

    :returns: a copy of the remote object
    """
    return pickle.loads(pickle.dumps(proxy))
Beispiel #4
0
 def __array__(self):
     # Note that protocol=-1 will only work between python
     # interpreters of the same version.
     return pickle.loads(syncreq(self, consts.HANDLE_PICKLE, -1))
Beispiel #5
0
 def __array__(self):
     return pickle.loads(syncreq(self, consts.HANDLE_PICKLE, -1))
Beispiel #6
0
 def __array__(self):
     # Note that protocol=-1 will only work between python
     # interpreters of the same version.
     return pickle.loads(syncreq(self, consts.HANDLE_PICKLE, -1))