[Twisted-Python] new doc generator, new doc

Steve Waterbury steve.waterbury at gsfc.nasa.gov
Thu Jun 20 23:45:34 EDT 2002


Glyph Lefkowitz wrote:
> 
> I have just spent some time improving our documentation preprocessor as well as
> writing a new document and fixing some old ones.  Everything's in CVS, though
> using generate-domdocs may be a little bit confusing, so I've put the relevant
> documents up on the web, too.
> 
>     http://zelda.twistedmatrix.com/doc/howto/plugin
>     http://zelda.twistedmatrix.com/doc/howto/defer
>     http://zelda.twistedmatrix.com/doc/howto/servers

Thanks for the nice docs, Glyph!  I think there may be 
a typo in the doc on Deferreds:

-----------------------------------------------------
# Case 1
d = getDeferredFromSomewhere()
d.addCallback(callback1)
d.addErrback(errback1)
d.addCallback(callback2)
d.addErrback(errback1)
             ^^^^^^^^--> shouldn't this be errback2? 
 # Case 2
d = getDeferredFromSomewhere()
d.addCallbacks(callback1, errback1)
d.addCallbacks(callback2, errback2)

If an error occurs in callback1, then for Case 1 errback1 will be called with the 
failure. For Case 2, errback2 will be called. Be careful with your callbacks and 
errbacks.
-----------------------------------------------------

For Case 1, the only errback that *can* be called, as it's written, is 
errback1 ... but I think even if the second errback in Case 1 is 
errback2, errback1 is still called, right?

-- Steve.

Stephen C. Waterbury  http://misspiggy.gsfc.nasa.gov/people/waterbug.html
    "An idiot with a computer is a faster, better idiot." - Rick Julius




More information about the Twisted-Python mailing list