On Thu, 2008-08-07 at 04:53 +0200, Jason Tackaberry wrote: > Log: > New classes InProgressAny and InProgressAll (should hopefully deprecate > InProgressSignals and InProgressList respectively); added properties result, > finished, failed to InProgress; added methods subset(), any() (creates > InProgressAny from signals), all() (creates InProgressAll from signals).
As I was reworking the state machine stuff for kaa.popcorn, I came up with a slightly new API for InProgressSignals and InProgressList that I think are named a lot better and make a lot more sense. In order to keep the convenience of InProgressSignals, I added some more functionality to the Signals class to work with InProgressAny/All and allows a nice chaining approach (reminds one a bit of jquery). Here are some examples to demonstrate the new API: # Old idx, result = yield kaa.InProgressSignals(self.signals, 'play', 'error') # New idx, result = yield self.signals.subset('play', 'error').any() # Old play_ip = kaa.InProgressCallback(self.signals['play']) ip = kaa.InProgressList(kaa.InProgressCallback(self.signals['open']), play_ip) yield ip print play_ip.result # New ip = yield self.signals.subset('open', 'play').all() print ip[1].result dischi, let me know what you think. I would also like to change the explicit support for Signal in InProgressCallback, which I, as you know, never liked. kaa.InProgressCallback(signal) can be replaced with signal.async(). (We can negotiate the name if you like.) Jason. ------------------------------------------------------------------------- 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