On Sun, 2008-07-20 at 20:34 +0200, Dirk Meyer wrote: > Should be fixed. BTW, maybe open fails and in that case you do not > want to call play (it makes no sense). So better use the coroutine > decorator. > > | @kaa.coroutine() > | def next(self, id): > | fname = self.fnames.pop(0) > | print 'play %s with %s' % (fname, id) > | yield self.player.open(fname, player=id) > > This now blocks until the stream is open or you get an > exception. After that call play: > > | self.player.play() > > No return allowed, return your result with yield > > | yield True
It would be better form to handle the exception, though. But since Player.open() is itself a coroutine, it returns an InProgress, so this should work too, and might be easier: self.player.open(fname).connect(lambda dummy: self.player.play()) Anyway, we do have some work to do on popcorn. Especially the whole properties stuff. You had some opinions on popcorn's direction, did you not? I seem to recall that opinion involving greatly simplifying (or removing) the state engine. Given that the user can now use coroutines to construct the state machine, that might make a lot of sense. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel