[Twisted-Python] declare pb.Copyable only once

Henning.Ramm at mediapro-gmbh.de Henning.Ramm at mediapro-gmbh.de
Wed Mar 16 04:58:04 MST 2005


Hi there!

At the moment I'm trying to wrap my mind around pb objects.

I learned from the pb.Copyable howto (http://twistedmatrix.com/documents/current/howto/pb-copyable) that I must setUnjellyableForClass every object that could be sent from a client.

I need a simple empty utility class like this:

class Info(pb.Copyable):
    def __init__(self, obj=None):
        if obj: self.__dict__.update(obj.__dict__)

Because I can use such in server as well as in client, I defined the class in the server and imported it in the client.

Nevertheless I get an InsecureJelly exception in the server.

If I setUnjellyable... it in the server as in
pb.setUnjellyableForClass(Info, Info)
I get an AttributeError: Info instance has no attribute 'unjellyFor'

Is there any way to declare this class only once and not separate for server and client?


Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.




More information about the Twisted-Python mailing list