[Sugar-devel] closing an activity immediately

Sascha Silbe sascha-ml-reply-to-2011-2 at silbe.org
Wed Feb 9 15:25:59 EST 2011


Excerpts from Erik Blankinship's message of Wed Feb 09 19:55:12 +0100 2011:

> class NotTodayActivity( activity.Activity ):
> 
>     def __init__( self, handle ):
>         activity.Activity.__init__( self, handle )
> 
>         self._auto_shut_down = False
>         if not self.should_this_activity_run_today( ):
>             self._auto_shut_down = True
>             logger.debug( "goin' down" )
>             self.close( )
>             return

There's a whole lot of stuff being run after Activity.__init__() before
the activity is actually "started" (take a look at the source [1]).
I haven't looked into it closely, but I suspect that your early
self.close() hangs because the widgets are not set up yet.

Sascha

[1] http://git.sugarlabs.org/sugar-toolkit/mainline/blobs/master/src/sugar/activity/activity.py
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110209/2df250ff/attachment.pgp>


More information about the Sugar-devel mailing list