~certify-web-dev/twisted/certify-staging

« back to all changes in this revision

Viewing changes to doc/howto/listings/deferred/deferred_ex6.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-01-02 19:38:17 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100102193817-jphp464ppwh7dulg
Tags: 9.0.0-1
* python-twisted: Depend on the python-twisted-* 9.0 packages.
* python-twisted: Depend on python-zope.interface only. Closes: #557781.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
 
1
#!/usr/bin/env python
 
2
 
 
3
# Copyright (c) 2009 Twisted Matrix Laboratories.
 
4
# See LICENSE for details.
2
5
 
3
6
from twisted.internet import defer
4
7
from twisted.python import failure, util
5
8
 
6
9
"""
7
 
now comes the more nuanced addCallbacks, which allows us to make a
 
10
Now comes the more nuanced addCallbacks, which allows us to make a
8
11
yes/no (branching) decision based on whether the result at a given point is
9
12
a failure or not.
10
13
 
11
14
here, we return the failure from noDecisionPassthru, the errback argument to
12
 
the first addCallbacks method invocation, and see what happens
13
 
 
 
15
the first addCallbacks method invocation, and see what happens.
14
16
"""
15
17
 
16
18
class Counter(object):