I use Pyro in a project and cannot figure out how to transfer a complete object by wire. The object is not distributed (my distributed objects work fine), but should function as an argument to an already accessible distributed object.
My object is derived from a custom class containing some methods, and some variables are an integer and a list. The class is available for both the server and the client. When using my object as an argument to the distributed object method, the whole variable is "accepted" correctly, but the list is empty, although I see that it contains values โโimmediately before it is "sent".
Why is this?
Short version of the class:
class Collection(Pyro.core.ObjBase): num = 0 operations = [("Operation:", "Value:", "Description", "Timestamp")] def __init__(self): Pyro.core.ObjBase.__init__(self) def add(self, val, desc): entry = ("Add", val, desc, strftime("%Y-%m-%d %H:%M:%S")) self.operations.append(entry) self.num = self.num + 1 def printop(self): print "This collection will execute the following operations:" for item in self.operations: print item
Distributed Object Receive Method:
def apply(self, collection): print "Todo: Apply collection"
source share