wsvoorhees
unread,Nov 19, 2008, 2:02:05 PM11/19/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rpyc
I have a use case where I think this isproxy command that was
apparently part of the 2.60 release would be very helpful, however it
seems that this command is no longer included (fgrep isproxy -R *
shows up nothing) Perhaps it was omitted because there is a better
mechanism in place now?
Here's what I'm trying to do:
Server:
import rpyc
class SomeService(rpyc.Service):
"This class holds a dictionary that contains images"
def on_connect(self):
self.images = {}
if __name__ == "__main__":
from rpyc.utils.server import ThreadedServer
s = ThreadedServer(SomeService, port = 18861)
s.start()
Client:
import rpyc
import Image
c = rpyc.connect("localhost", 18861)
o = c.root
bike_image = Image.open("bicycle.png")
o.images['bike_image'] = bike_image
However, in this case images[bike_image] is a proxy object, but I want
to force it to be a real object on the server, and a proxy object on
the client. To accomplish this goal, I think I'm going to impliment a
dictionary class that overrides the __setattr__ to insist that it gets
a real object and not a proxy object. Is there a better way to do
this?
-Will