diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2013-02-06 23:38:01 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2013-02-06 23:38:01 +0200 |
| commit | 6a4c6cb1c6ebe148e948726ddf668a3c2aa6c86c (patch) | |
| tree | 76bf818f0a2ac3a4dd23c60330715c900406a31e /docs | |
| parent | c8a52c85dd9d80ab25063e65617a8894a27f9ee1 (diff) | |
| download | pyramid-6a4c6cb1c6ebe148e948726ddf668a3c2aa6c86c.tar.gz pyramid-6a4c6cb1c6ebe148e948726ddf668a3c2aa6c86c.tar.bz2 pyramid-6a4c6cb1c6ebe148e948726ddf668a3c2aa6c86c.zip | |
no need for a 'topic' directive
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/configuration.rst | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/docs/narr/configuration.rst b/docs/narr/configuration.rst index cd3dab099..4370367c0 100644 --- a/docs/narr/configuration.rst +++ b/docs/narr/configuration.rst @@ -99,29 +99,27 @@ available for a :term:`scan` to find it later. A :term:`scan` of a :term:`module` or a :term:`package` and its subpackages for decorations happens when the :meth:`pyramid.config.Configurator.scan` method is invoked: scanning implies searching for configuration declarations -in a package and its subpackages. For example: - -.. topic:: Starting A Scan - - .. code-block:: python - :linenos: - - from wsgiref.simple_server import make_server - from pyramid.config import Configurator - from pyramid.response import Response - from pyramid.view import view_config - - @view_config() - def hello(request): - return Response('Hello') - - if __name__ == '__main__': - from pyramid.config import Configurator - config = Configurator() - config.scan() - app = config.make_wsgi_app() - server = make_server('0.0.0.0', 8080, app) - server.serve_forever() +in a package and its subpackages. For example:: + +.. code-block:: python + :linenos: + + from wsgiref.simple_server import make_server + from pyramid.config import Configurator + from pyramid.response import Response + from pyramid.view import view_config + + @view_config() + def hello(request): + return Response('Hello') + + if __name__ == '__main__': + from pyramid.config import Configurator + config = Configurator() + config.scan() + app = config.make_wsgi_app() + server = make_server('0.0.0.0', 8080, app) + server.serve_forever() The scanning machinery imports each module and subpackage in a package or module recursively, looking for special attributes attached to objects |
