Ticket #6071: react-reactor-arg-6071-v1.patch

File react-reactor-arg-6071-v1.patch, 1.1 KB (added by Adam Dangoor, 8 years ago)

Addresses tomprince's comments

  • twisted/internet/task.py

    diff --git a/twisted/internet/task.py b/twisted/internet/task.py
    index f784f14..a7d07d4 100644
    a b def react(main, argv=(), _reactor=None): 
    813813      - Exit the application when done, with exit code 0 in case of success and
    814814        1 in case of failure. If C{main} fails with a C{SystemExit} error, the
    815815        code returned is used.
     816      - The following is a simple example of a C{main} function::
     817          def main(reactor, username, password):
     818              pass
    817     @param main: A callable which returns a L{Deferred}.  It should take as
    818         many arguments as there are elements in the list C{argv}. Called with
    819         _reactor as first parameter.
     820          task.react(main, ('alice', 'secret'))
     822    @param main: A callable which returns a L{Deferred}. It should
     823        take the reactor as its first parameter, followed by the elements of
     824        C{argv}.
    821826    @param argv: A list of arguments to pass to C{main}. If omitted the
    822827        callable will be invoked with no additional arguments.