Grammer and readability fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jeff Widman · committed by Jeff Widman · parent 6521c36 · Browse files · 1 file·+8 added−8 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+8 added−8 removed
- other:+8 added−8 removed
Provenance
- Commit
ffe0c54- Tree
c9273fc- Author
Jeff Widman <jeff@jeffwidman.com>- Committer
Jeff Widman <jeff@jeffwidman.com>- Parent
6521c36
1 file changed+8 added−8 removed
modified:docs/signals.rst+8 added-8 removed
24 unmodified lines25 early by returning a response. In contrast all signal handlers are26 executed in undefined order and do not modify any data.27 28 The big advantage of signals over handlers is that you can safely29-subscribe to them for the split of a second. These temporary29+subscribe to them for just a split second. These temporary30 subscriptions are helpful for unittesting for example. Say you want to31 know what templates were rendered as part of a request: signals allow you32 to do exactly that.33 7 unmodified lines41 signal, you can use the :meth:`~blinker.base.Signal.disconnect` method.42 43 For all core Flask signals, the sender is the application that issued the44 signal. When you subscribe to a signal, be sure to also provide a sender45-unless you really want to listen for signals of all applications. This is45+unless you really want to listen for signals from all applications. This is46 especially true if you are developing an extension.47 48-Here for example a helper context manager that can be used to figure out49-in a unittest which templates were rendered and what variables were passed48+For example, here is a helper context manager that can be used in a unittest49+to determine which templates were rendered and what variables were passed50 to the template::51 52 from flask import template_rendered53 from contextlib import contextmanager27 unmodified lines81 variable. Whenever a template is rendered, the template object as well as82 context are appended to it.83 84 Additionally there is a convenient helper method85-(:meth:`~blinker.base.Signal.connected_to`). that allows you to85+(:meth:`~blinker.base.Signal.connected_to`) that allows you to86 temporarily subscribe a function to a signal with a context manager on87 its own. Because the return value of the context manager cannot be88-specified that way one has to pass the list in as argument::88+specified that way, you have to pass the list in as an argument::89 90 from flask import template_rendered91 92 def captured_templates(app, recorded, **extra):114 unmodified lines207 208 .. data:: flask.request_started209 :noindex:210 211- This signal is sent before any request processing started but when the212- request context was set up. Because the request context is already211+ This signal is sent when the request context is set up, before212+ any request processing happens. Because the request context is already213 bound, the subscriber can access the request with the standard global214 proxies such as :class:`~flask.request`.215 216 Example subscriber::136 unmodified lines