[TransWarp] is there a chance that SEF class-tree's will be pickle-able??

Phillip J. Eby pje at telecommunity.com
Thu Apr 4 09:24:09 EST 2002

At 03:31 PM 4/4/02 +0200, Ulrich Eck wrote:
>I tried Pyro first and it does not coop, because it relies on pickle.
>so i started inspecting what's the problem .. here what i found out:
>i have a simple test-app:
>from TW.API import *
>class App(SEF.App):
>         title = 'PyroApp'
>         class MyService(SEF.Service):

There are two easy ways to fix this in the short term.  You can either copy 
"MyService" into the module namespace, e.g.:

MyService = App.MyService

Or define MyService in another module and then import it.  (This is the 
technique I'm more likely to use.)

The problem is that nested classes are inherently unpicklable, unless you 
do something about it.  Older TransWarp versions would make MyService have 
a class name of 'App.MyService' and copy them into the module dictionary 
for you.  It would probably be a good idea for me to put that capability 
into setupModule(), so that you don't need to worry about this sort of 
thing.  Until I do, though, you can work around it as I have described above.

You will run into another problem with pickling, by the way... 'Once' 
attributes should really not be included in a pickle, but I have not yet 
implemented an ActiveDescriptors.__getstate__ method that ensures this.

>Is there a chance that we can use Pyro with SEF/Transwarp (Class-Trees) 

If pickling is the only problem, then yes.  I'm curious, however, why you 
would need to pickle an entire application for use with Pyro; it seems 
strange to me to send an entire application over-the-wire!

>p.s. have you had a look at the cvs-source of TWGUI ??

Nope; haven't had the time or inclination really, since I don't have any 
projects needing GUI's at present.

More information about the PEAK mailing list