diff options
| author | Tres Seaver <tseaver@palladion.com> | 2012-04-06 01:14:45 +0000 |
|---|---|---|
| committer | Tres Seaver <tseaver@palladion.com> | 2012-04-06 01:14:45 +0000 |
| commit | dc20d6e62d281e4720ecb317a408611fe2f933c8 (patch) | |
| tree | 1ae71e0a46c83162553fe80bff56b262f735f509 /docs | |
| parent | cc769a733355d2bc147ff1e7dbf5b4f75f292100 (diff) | |
| download | zope-interface-dc20d6e62d281e4720ecb317a408611fe2f933c8.tar.gz | |
Ensure that all doctest blocks get recognized by Sphinx.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/README.rst | 6 | ||||
| -rw-r--r-- | docs/README.ru.rst | 4 | ||||
| -rw-r--r-- | docs/adapter.rst | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/docs/README.rst b/docs/README.rst index 253d1ed..482cd12 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -232,7 +232,7 @@ Note that the implementer decorator may modify it's argument. Callers should not assume that a new object is created. Using implementer also works on callable objects. This is used by -zope.formlib, as an example. +zope.formlib, as an example:: >>> class yfactory: ... def __call__(self, y): @@ -248,7 +248,7 @@ zope.formlib, as an example. XXX: Double check and update these version numbers: In zope.interface 3.5.2 and lower, the implementer decorator can not -be used for classes, but in 3.6.0 and higher it can: +be used for classes, but in 3.6.0 and higher it can:: >>> Foo = zope.interface.implementer(IFoo)(Foo) >>> list(zope.interface.providedBy(Foo())) @@ -756,6 +756,8 @@ Adapter hooks (see __adapt__) will also be used, if present:: __adapt__ --------- +:: + >>> class I(zope.interface.Interface): ... pass diff --git a/docs/README.ru.rst b/docs/README.ru.rst index a284c9a..318389a 100644 --- a/docs/README.ru.rst +++ b/docs/README.ru.rst @@ -234,7 +234,7 @@ API для объявления интерфейсов. XXX: Double check and update these version numbers, and translate to russian: In zope.interface 3.5.1 and lower, the implementer decorator can not -be used for classes, but in 3.5.2 and higher it can: +be used for classes, but in 3.5.2 and higher it can:: >>> Foo = zope.interface.implementer(IFoo)(Foo) >>> list(zope.interface.providedBy(Foo())) @@ -737,6 +737,8 @@ IBase:: __adapt__ --------- +:: + >>> class I(zope.interface.Interface): ... pass diff --git a/docs/adapter.rst b/docs/adapter.rst index 298a862..43d100b 100644 --- a/docs/adapter.rst +++ b/docs/adapter.rst @@ -120,7 +120,7 @@ Finding out what, if anything, is registered We can ask if there is an adapter registered for a collection of interfaces. This is different than lookup, because it looks for an -exact match. +exact match:: >>> print registry.registered([IR1], IP1) 11 @@ -199,7 +199,7 @@ We can register and lookup by name too:: When the adapter factory produces `None`, then this is treated as if no adapter has been found. This allows us to prevent adaptation (when desired) and let the adapter factory determine whether adaptation is possible based on -the state of the object being adapted. +the state of the object being adapted:: >>> def factory(context): ... if context.name == 'object': @@ -274,7 +274,7 @@ Dict adapters ------------- At some point it was impossible to register dictionary-based adapters due a -bug. Let's make sure this works now: +bug. Let's make sure this works now:: >>> adapter = {} >>> registry.register((), IQ, '', adapter) @@ -489,7 +489,7 @@ can unregister a specific subscriber:: ['sub_1', 'sub12 1', 'sub12 2'] If we don't specify a value, then all subscribers matching the given -interfaces will be unsubscribed: +interfaces will be unsubscribed:: >>> registry.unsubscribe([IR1], IP2) >>> registry.subscriptions([IR1], IP1) |
