diff options
| author | Stephan Richter <stephan.richter@gmail.com> | 2014-02-05 09:02:18 -0500 |
|---|---|---|
| committer | Stephan Richter <stephan.richter@gmail.com> | 2014-02-05 09:02:18 -0500 |
| commit | 102a0bad52749d64d615fc569f26dc5617393f71 (patch) | |
| tree | 7764d5f332cb1f135d9a2b041a83a51a0957234b /docs | |
| parent | 79a266200384fa53fb3810ed316a94394166f4e3 (diff) | |
| download | zope-interface-102a0bad52749d64d615fc569f26dc5617393f71.tar.gz | |
Remove trailing whitespace.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/adapter.rst | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/adapter.rst b/docs/adapter.rst index f2aecfc..b948705 100644 --- a/docs/adapter.rst +++ b/docs/adapter.rst @@ -160,7 +160,7 @@ exact match: >>> print registry.registered([IR1], IP2, 'bob') Bob's 12 - + >>> print registry.registered([IR2], IP1) 21 @@ -200,7 +200,7 @@ factories: >>> class X: ... zope.interface.implements(IR) - + >>> class Y: ... zope.interface.implements(IP1) ... def __init__(self, context): @@ -250,7 +250,7 @@ the state of the object being adapted: ... zope.interface.implements(IR) ... name = 'object' - >>> registry.register([IR], IP1, 'conditional', factory) + >>> registry.register([IR], IP1, 'conditional', factory) >>> obj = Object() >>> registry.queryAdapter(obj, IP1, 'conditional') 'adapter' @@ -283,14 +283,14 @@ mechanism. Default Adapters ---------------- - + Sometimes, you want to provide an adapter that will adapt anything. For that, provide None as the required interface: .. doctest:: >>> registry.register([None], IP1, '', 1) - + then we can use that adapter for interfaces we don't have specific adapters for: @@ -308,6 +308,7 @@ Of course, specific adapters are still used when applicable: >>> registry.lookup([IR2], IP1, '') 21 + Class adapters -------------- @@ -420,7 +421,7 @@ and, of course, we can use names: 'M2' >>> m.x is x and m.q is q True - + Default Adapters ---------------- @@ -538,7 +539,7 @@ Subscriptions can be on multiple specifications: >>> registry.subscribe([IR1, IQ], IP2, 'sub1q2') >>> registry.subscriptions([IR1, IQ], IP2) ['sub1q2'] - + As with single subscriptions and non-subscription adapters, you can specify None for the first required interface, to specify a default: @@ -553,7 +554,7 @@ specify None for the first required interface, to specify a default: You can have subscriptions that are indepenent of any specifications: .. doctest:: - + >>> list(registry.subscriptions([], IP1)) [] |
