Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pyramid.pdf
Скачиваний:
10
Добавлен:
24.03.2015
Размер:
3.82 Mб
Скачать

30. PYRAMID CONFIGURATION INTROSPECTION

30.4 Introspection in the Toolbar

The Pyramid debug toolbar (part of the pyramid_debugtoolbar package) provides a canned view of all registered introspectables and their relationships. It looks something like this:

30.5 Disabling Introspection

You can disable Pyramid introspection by passing the flag introspection=False to the Configurator constructor in your application setup:

from pyramid.config import Configurator

config = Configurator(..., introspection=False)

When introspection is False, all introspectables generated by configuration directives are thrown away.

354

CHAPTER

THIRTYONE

EXTENDING AN EXISTING

PYRAMID APPLICATION

If a Pyramid developer has obeyed certain constraints while building an application, a third party should be able to change the application’s behavior without needing to modify its source code. The behavior of a Pyramid application that obeys certain constraints can be overridden or extended without modification.

We’ll define some jargon here for the benefit of identifying the parties involved in such an effort.

Developer The original application developer.

Integrator Another developer who wishes to reuse the application written by the original application developer in an unanticipated context. He may also wish to modify the original application without changing the original application’s source code.

31.1The Difference Between “Extensible” and “Pluggable” Applications

Other web frameworks, such as Django, advertise that they allow developers to create “pluggable applications”. They claim that if you create an application in a certain way, it will be integratable in a sensible, structured way into another arbitrarily-written application or project created by a third-party developer.

Pyramid, as a platform, does not claim to provide such a feature. The platform provides no guarantee that you can create an application and package it up such that an arbitrary integrator can use it as a subcomponent in a larger Pyramid application or project. Pyramid does not mandate the constraints necessary

355

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]