Re: [Twisted-Python] inlineCallbacksDecorator

2009-06-08 Thread Terry Jones
> "Drew" == Drew Smathers writes: Drew> On Sat, Jun 6, 2009 at 9:41 PM, Terry Jones wrote: >> One inconvenience with inlineCallbacks is that you might have some kind >> of processing you want done no matter how the function returns, or >> wherever an error occurs. Two solutions here are 1) to

Re: [Twisted-Python] inlineCallbacksDecorator

2009-06-08 Thread Drew Smathers
On Sat, Jun 6, 2009 at 9:41 PM, Terry Jones wrote: > I try to avoid using inlineCallbacks. There are two cases where I will > happily use it though: when I write a method that would need more than a > few callback functions, and, more importantly, when the logical flow of a > method is non-trivial

Re: [Twisted-Python] inlineCallbacksDecorator

2009-06-07 Thread Terry Jones
Hi Maarten > "Maarten" == Maarten ter Huurne writes: Maarten> As far as I can see, this decorator could be applied to any Maarten> function that returns a Deferred, not just to inlineCallbacks. Yes, that's right, and it could be used in that case if you didn't want to deal with the deferred

Re: [Twisted-Python] inlineCallbacksDecorator

2009-06-06 Thread Maarten ter Huurne
On Sunday 07 June 2009, Terry Jones wrote: > So I wrote a decorator specifically for inlineCallbacks decorated > functions: > > from twisted.internet import defer > > def inlineCallbacksDecorator(callback, errback=defer.passthru): > def wrap(f): > def wrapper(*args, **k

[Twisted-Python] inlineCallbacksDecorator

2009-06-06 Thread Terry Jones
I try to avoid using inlineCallbacks. There are two cases where I will happily use it though: when I write a method that would need more than a few callback functions, and, more importantly, when the logical flow of a method is non-trivial (i.e., it depends on the returned values or errors of sever