From 95205583fbd6677f415eb7e62ea4b49b297642f4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 29 Nov 2009 18:20:44 +0000 Subject: Meh. --- CHANGES.txt | 55 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 10 deletions(-) (limited to 'CHANGES.txt') 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 `_ and + `Tornado `_. ``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 -- cgit v1.2.3