[Twisted-Python] adbapi.operationDone
Andrew Bennetts
andrew-twisted at puzzling.org
Mon Dec 9 17:33:37 EST 2002
On Mon, Dec 09, 2002 at 03:29:29PM -0500, Steve Waterbury wrote:
> Twisted Gurus,
>
> Yet another sophomoric question :^) ...
>
> The only way I've come up with to pass in a value to
> adbapi.Augmentation.operationDone(done) is as follows:
>
> class MyAug(Augmentation):
> def addThingy(self, whatever):
> args = munge(whatever) # make some sql, etc.
> out = self.runOperation(*args)
> out.addCallback(lambda x: self.operationDone('addThingy'))
> out.addErrback(self.operationError)
> ...
>
> This works, but is there a more orthodox(/elegant) way? I've
> tried many permutations of using callbackArgs, without success.
What about:
out.addCallback(self.operationDone)
?
The idea of course is that you subclass operationDone to be whatever you
want. You're also free to ignore it; it's a convenience function.
I probably should update the "Introduction to Twisted Enterprise" doc to
make this clearer :)
> BTW, thanks for all the new twisted stuff ... I'm just starting
> to use lore ... very cool!
Thanks! :)
Lore's quite new though, so if you've got any feedback Moshe and I would
love to hear it.
-Andrew.
More information about the Twisted-Python
mailing list