summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-29 18:20:44 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-29 18:20:44 +0000
commit95205583fbd6677f415eb7e62ea4b49b297642f4 (patch)
tree8fa867d6d1640e444a272ac2264218c49c177901
parent52ced090679517fab87066fc1345f8740f821244 (diff)
downloadpyramid-95205583fbd6677f415eb7e62ea4b49b297642f4.tar.gz
pyramid-95205583fbd6677f415eb7e62ea4b49b297642f4.tar.bz2
pyramid-95205583fbd6677f415eb7e62ea4b49b297642f4.zip
Meh.
-rw-r--r--CHANGES.txt55
-rw-r--r--docs/whatsnew-1.2.rst68
2 files changed, 81 insertions, 42 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3464bf2ef..94779ecf4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,11 +5,12 @@ Bug Fixes
---------
- Trying to use an HTTP method name string such as ``GET`` as a
- ``request_type`` predicate caused a startup time failure when it was
- encountered in imperative configuration or in a decorator (symptom:
- ``Type Error: Required specification must be a specification``).
- This now works again, although ``request_method`` is a more modern
- predicate.
+ ``request_type`` predicate argument caused a startup time failure
+ when it was encountered in imperative configuration or in a
+ decorator (symptom: ``Type Error: Required specification must be a
+ specification``). This now works again, although ``request_method``
+ is now the preferred predicate argument for associating a view
+ configuration with an HTTP request method.
1.2a1 (2009-11-28)
==================
@@ -17,6 +18,39 @@ Bug Fixes
Features
--------
+- An imperative configuration mode.
+
+ A ``repoze.bfg`` application can now begin its life as a single
+ Python file. Later, the application might evolve into a set of
+ Python files in a package. Even later, it might start making use of
+ other configuration features, such as ``ZCML``. But neither the use
+ of a package nor the use of non-imperative configuration is required
+ to create a simple ``repoze.bfg`` application any longer.
+
+ Imperative configuration makes ``repoze.bfg`` competetive with
+ "microframeworks" such as `Bottle <http://bottle.paws.de/>`_ and
+ `Tornado <http://www.tornadoweb.org/>`_. ``repoze.bfg`` has a good
+ deal of functionality that most microframeworks lack, so this is
+ hopefully a "best of both worlds" feature.
+
+ The simplest possible ``repoze.bfg`` application is now:
+
+ .. code-block:: python
+ :linenos:
+
+ from webob import Response
+ from wsgiref import simple_server
+ from repoze.bfg.configuration import Configurator
+
+ def hello_world(request):
+ return Response('Hello world!')
+
+ if __name__ == '__main__':
+ config = Configurator()
+ config.add_view(hello_world)
+ app = config.make_wsgi_app()
+ simple_server.make_server('', 8080, app).serve_forever()
+
- A new class now exists: ``repoze.bfg.configuration.Configurator``.
This class forms the basis for sharing machinery between
"imperatively" configured applications and traditional
@@ -44,14 +78,15 @@ Features
default-created registry if ``registry`` is ``None``) instead of the
registry returned by ``zope.component.getGlobalSiteManager``,
causing the Zope Component Architecture API (``getSiteManager``,
- ``getAdapter``, ``getUtility``, and so on) to use the registry we're
- using for testing instead of the global ZCA registry.
+ ``getAdapter``, ``getUtility``, and so on) to use the testing
+ registry instead of the global ZCA registry.
- The ``repoze.bfg.testing.tearDown`` function now accepts an
``unhook_zca`` argument. If this argument is ``True`` (the
- default), ``zope.component.getSiteManager.reset()`` will be called,
- causing the "base" registry to once again start returnining the
- result of ``zope.component.getSiteManager``.
+ default), ``zope.component.getSiteManager.reset()`` will be called.
+ This will cause the result of the ``zope.component.getSiteManager``
+ function to be the global ZCA registry (the result of
+ ``zope.component.getGlobalSiteManager``) once again.
- The ``run.py`` module in various ``repoze.bfg`` ``paster`` templates
now use a ``repoze.bfg.configuration.Configurator`` class instead of
diff --git a/docs/whatsnew-1.2.rst b/docs/whatsnew-1.2.rst
index 840074cbd..06c8a312c 100644
--- a/docs/whatsnew-1.2.rst
+++ b/docs/whatsnew-1.2.rst
@@ -10,40 +10,43 @@ documentation additions.
Major Feature Additions
-----------------------
-The major feature additions of 1.2 are:
+The major feature addition in 1.2 is an :term:`imperative
+configuration` mode.
-- An :term:`imperative configuration` mode. This feature makes
- :mod:`repoze.bfg` competetive with "microframeworks" such as `Bottle
- <http://bottle.paws.de/>`_ and `Tornado
- <http://www.tornadoweb.org/>`_, because it means that
- :mod:`repoze.bfg` applications can begin life as a single file.
- Later, the application may evolve into a package, and may start
- making use of other configuration features, such as :term:`ZCML`.
- :mod:`repoze.bfg` has a good deal of functionality that
- microframeworks lack, so this is meant as a a "best of both worlds"
- feature.
+A :mod:`repoze.bfg` application can now begin its life as a single
+Python file. Later, the application might evolve into a set of Python
+files in a package. Even later, it might start making use of other
+configuration features, such as :term:`ZCML` and perhaps a
+:term:`scan`. But neither the use of a package nor the use of
+non-imperative configuration is required to create a simple
+:mod:`repoze.bfg` application any longer.
- As a result of :term:`imperative configuration`, the simplest
- possible :mod:`repoze.bfg` application is now:
+:term:`Imperative configuration` makes :mod:`repoze.bfg` competitive
+with "microframeworks" such as `Bottle <http://bottle.paws.de/>`_ and
+`Tornado <http://www.tornadoweb.org/>`_. :mod:`repoze.bfg` has a good
+deal of functionality that most microframeworks lack, so this is
+hopefully a "best of both worlds" feature.
- .. code-block:: python
- :linenos:
+The simplest possible :mod:`repoze.bfg` application is now:
- from webob import Response
- from wsgiref import simple_server
- from repoze.bfg.configuration import Configurator
+ .. code-block:: python
+ :linenos:
- def hello_world(request):
- return Response('Hello world!')
+ from webob import Response
+ from wsgiref import simple_server
+ from repoze.bfg.configuration import Configurator
- if __name__ == '__main__':
- config = Configurator()
- config.add_view(hello_world)
- app = config.make_wsgi_app()
- simple_server.make_server('', 8080, app).serve_forever()
+ def hello_world(request):
+ return Response('Hello world!')
- For an introduction to imperative-mode configuration, see
- :ref:`configuration_narr`.
+ if __name__ == '__main__':
+ config = Configurator()
+ config.add_view(hello_world)
+ app = config.make_wsgi_app()
+ simple_server.make_server('', 8080, app).serve_forever()
+
+For an introduction to imperative-mode configuration, see
+:ref:`configuration_narr`.
Minor Miscellaneous Feature Additions
-------------------------------------
@@ -70,14 +73,15 @@ Minor Miscellaneous Feature Additions
default-created registry if ``registry`` is ``None``) instead of the
registry returned by ``zope.component.getGlobalSiteManager``,
causing the Zope Component Architecture API (``getSiteManager``,
- ``getAdapter``, ``getUtility``, and so on) to use the registry we're
- using for testing instead of the global ZCA registry.
+ ``getAdapter``, ``getUtility``, and so on) to use the testing
+ registry instead of the global ZCA registry.
- The ``repoze.bfg.testing.tearDown`` function now accepts an
``unhook_zca`` argument. If this argument is ``True`` (the
- default), ``zope.component.getSiteManager.reset()`` will be called,
- causing the "base" registry to once again start returnining the
- result of ``zope.component.getSiteManager``.
+ default), ``zope.component.getSiteManager.reset()`` will be called.
+ This will cause the result of the ``zope.component.getSiteManager``
+ function to be the global ZCA registry (the result of
+ ``zope.component.getGlobalSiteManager``) once again.
Backwards Incompatibilites
--------------------------