diff options
| author | Chris McDonough <chrism@plope.com> | 2011-12-03 21:04:24 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-12-03 21:04:24 -0500 |
| commit | b40fb8b26fe37102b076cd2310ea7a3fe8b79311 (patch) | |
| tree | af7b613da26ce2d20c58ff7d78ec48efb87941b8 /docs | |
| parent | 79f34b817580f1043270b467a3c79aeeaebd9233 (diff) | |
| download | pyramid-b40fb8b26fe37102b076cd2310ea7a3fe8b79311.tar.gz pyramid-b40fb8b26fe37102b076cd2310ea7a3fe8b79311.tar.bz2 pyramid-b40fb8b26fe37102b076cd2310ea7a3fe8b79311.zip | |
add a noop introspector (allow introspection to be turned off)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/api/registry.rst | 5 | ||||
| -rw-r--r-- | docs/narr/introspector.rst | 20 |
2 files changed, 23 insertions, 2 deletions
diff --git a/docs/api/registry.rst b/docs/api/registry.rst index 3dbf73a67..25192f3ed 100644 --- a/docs/api/registry.rst +++ b/docs/api/registry.rst @@ -38,4 +38,9 @@ This class is new as of :app:`Pyramid` 1.3. +.. class:: noop_introspector + + An introspector which throws away all registrations, useful for disabling + introspection altogether (pass as ``introspector`` to the + :term:`Configurator` constructor). diff --git a/docs/narr/introspector.rst b/docs/narr/introspector.rst index ac0859164..71b41773c 100644 --- a/docs/narr/introspector.rst +++ b/docs/narr/introspector.rst @@ -512,8 +512,8 @@ introspectables in categories not described here. The ``over`` argument passed to ``add_tween`` (a string). -Toolbar Introspection ---------------------- +Introspection in the Toolbar +---------------------------- The Pyramid debug toolbar (part of the ``pyramid_debugtoolbar`` package) provides a canned view of all registered introspectables and their @@ -521,4 +521,20 @@ relationships. It looks something like this: .. image:: tb_introspector.png +Disabling Introspection +----------------------- +You can disable Pyramid introspection by passing the object +:attr:`pyramid.registry.noop_introspector` to the :term:`Configurator` +constructor in your application setup: + +.. code-block:: python + + from pyramid.config import Configurator + from pyramid.registry import noop_introspector + config = Configurator(..., introspector=noop_introspector) + +When the noop introspector is active, all introspectables generated by the +framework are thrown away. A noop introspector behaves just like a "real" +introspector, but the methods of a noop introspector do nothing and return +null values. |
