[Twisted-Python] Newbie question on how to send "complex" objects over the wire

Jean-Paul Calderone exarkun at divmod.com
Tue Oct 17 20:47:24 EDT 2006


On Wed, 18 Oct 2006 02:05:28 +0200, Franz Zieher <franz.zieher at gmail.com> wrote:
>Can anybody provide a an example on how I would best send
>a data structure (i.e. an ElemenTree from elementtree) over from
>a server to a client process. I followed somewhat the example in
>the documentation and used the perspective broker "pb" to send
>an "simple" structure (some class with simple members)

Would suggesting you transfer it as serialized XML be too silly? :)

>
>When I changed to a more complex class definition, I obviously got
>an InsecureJelly exception.

You need to subclass a jellyable type, although it would be a simple
matter to extend jelly to support an external registration mechanism
and lift this restriction.  Take a look at twisted/spread/jelly.py,
in particular the _Jellier class's jelly method.

Jean-Paul




More information about the Twisted-Python mailing list