From fca1efe07ac46b2817f30299bbebbc2031cce339 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 6 Jul 2011 14:57:59 -0400 Subject: - The ``config.scan`` method has grown a ``**kw`` argument. ``kw`` argument represents a set of keyword arguments to pass to the Venusian ``Scanner`` object created by Pyramid. (See the Venusian documentation for more information about ``Scanner``). --- CHANGES.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 0eb02baad..041ff0bb7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,11 @@ Next release Features -------- +- The ``config.scan`` method has grown a ``**kw`` argument. ``kw`` argument + represents a set of keyword arguments to pass to the Venusian ``Scanner`` + object created by Pyramid. (See the Venusian documentation for more + information about ``Scanner``). + - New request attribute: ``json``. If the request's ``content_type`` is ``application/json``, this attribute will contain the JSON-decoded variant of the request body. If the request's ``content_type`` is not -- cgit v1.2.3 From b44aab103120749bd42e531974f28e67c16a1be0 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 9 Jul 2011 08:52:23 -0400 Subject: add a note about response wrapping bug fix --- CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 041ff0bb7..feabf0e26 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -65,6 +65,14 @@ Features to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache`` with the first element of ``None``, e.g.: ``(None, {'public':True})``. +Bug Fixes +--------- + +- Framework wrappers of the original view (such as http_cached and so on) + relied on being able to trust that the response they were receiving was an + IResponse. It wasn't always, because the response was resolved by the + router instead of early in the view wrapping process. This has been fixed. + 1.1a4 (2011-07-01) ================== -- cgit v1.2.3 From 6a0602b3ce4d2a6de9dca25d8e0d390796a79267 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 9 Jul 2011 21:12:06 -0400 Subject: request.json -> request.json_body; add some docs for json_body --- CHANGES.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index feabf0e26..ff4036036 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,10 +9,9 @@ Features object created by Pyramid. (See the Venusian documentation for more information about ``Scanner``). -- New request attribute: ``json``. If the request's ``content_type`` is - ``application/json``, this attribute will contain the JSON-decoded - variant of the request body. If the request's ``content_type`` is not - ``application/json``, this attribute will be ``None``. +- New request property: ``json_body``. This property will return the + JSON-decoded variant of the request body. If the request body is not + well-formed JSON, this property will raise an exception. - A new value ``http_cache`` can be used as a view configuration parameter. @@ -73,6 +72,12 @@ Bug Fixes IResponse. It wasn't always, because the response was resolved by the router instead of early in the view wrapping process. This has been fixed. +Documentation +------------- + +- Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded + Request Body" (usage of ``request.json_body``). + 1.1a4 (2011-07-01) ================== -- cgit v1.2.3 From 7565006cf1f3b929d9ea54256214f3a39385936a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 10 Jul 2011 00:30:30 -0400 Subject: add info to changes.txt and whatsnew about pshell changes; removed unused import and unwrap string --- CHANGES.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index ff4036036..ae8395234 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,21 @@ Next release Features -------- +- It is now possible to invoke ``paster pshell`` even if the paste ini file + section name pointed to in its argument is not actually a Pyramid WSGI + application. The shell will work in a degraded mode, and will warn the + user. See "The Interactive Shell" in the "Creating a Pyramid Project" + narrative documentation section. + +- ``paster pshell`` now offers more built-in global variables by default + (including ``app`` and ``settings``). See "The Interactive Shell" in the + "Creating a Pyramid Project" narrative documentation section. + +- It is now possible to add a ``[pshell]`` section to your application's .ini + configuration file, which influences the global names available to a pshell + session. See "Extending the Shell" in the "Creating a Pyramid Project" + narrative documentation chapter. + - The ``config.scan`` method has grown a ``**kw`` argument. ``kw`` argument represents a set of keyword arguments to pass to the Venusian ``Scanner`` object created by Pyramid. (See the Venusian documentation for more @@ -78,6 +93,15 @@ Documentation - Added a section in the "Webob" chapter named "Dealing With A JSON-Encoded Request Body" (usage of ``request.json_body``). +Behavior Changes +---------------- + +- The ``paster pshell``, ``paster proutes``, and ``paster pviews`` commands + now take a single argument in the form ``/path/to/config.ini#sectionname`` + rather than the previous 2-argument spelling ``/path/to/config.ini + sectionname``. ``#sectionname`` may be omitted, in which case ``#main`` is + assumed. + 1.1a4 (2011-07-01) ================== -- cgit v1.2.3 From a36fdbd40967117d34a70f156d2865aa2b21991e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 10 Jul 2011 01:13:44 -0400 Subject: prep for 1.1b1 --- CHANGES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index ae8395234..2dead04b4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ -Next release -============ +1.1b1 (2011-07-10) +================== Features -------- -- cgit v1.2.3 From 82efa44c0d8f4b18b4f341519f54ecad68b56364 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 12 Jul 2011 03:52:42 -0400 Subject: - Previously, If a ``BeforeRender`` event subscriber added a value via the ``__setitem__`` or ``update`` methods of the event object with a key that already existed in the renderer globals dictionary, a ``KeyError`` was raised. With the deprecation of the "add_renderer_globals" feature of the configurator, there was no way to override an existing value in the renderer globals dictionary that already existed. Now, the event object will overwrite an older value that is already in the globals dictionary when its ``__setitem__`` or ``update`` is called (as well as the new ``setdefault`` method), just like a plain old dictionary. As a result, for maximum interoperability with other third-party subscribers, if you write an event subscriber meant to be used as a BeforeRender subscriber, your subscriber code will now need to (using ``.get`` or ``__contains__`` of the event object) ensure no value already exists in the renderer globals dictionary before setting an overriding value. --- CHANGES.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 2dead04b4..b9e645a38 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,24 @@ +Next Release +============ + +Behavior Changes +---------------- + +- Previously, If a ``BeforeRender`` event subscriber added a value via the + ``__setitem__`` or ``update`` methods of the event object with a key that + already existed in the renderer globals dictionary, a ``KeyError`` was + raised. With the deprecation of the "add_renderer_globals" feature of the + configurator, there was no way to override an existing value in the + renderer globals dictionary that already existed. Now, the event object + will overwrite an older value that is already in the globals dictionary + when its ``__setitem__`` or ``update`` is called (as well as the new + ``setdefault`` method), just like a plain old dictionary. As a result, for + maximum interoperability with other third-party subscribers, if you write + an event subscriber meant to be used as a BeforeRender subscriber, your + subscriber code will now need to (using ``.get`` or ``__contains__`` of the + event object) ensure no value already exists in the renderer globals + dictionary before setting an overriding value. + 1.1b1 (2011-07-10) ================== -- cgit v1.2.3 From 94ab244f121fa1bf8df57f75fad9da5f5f39c594 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 12 Jul 2011 19:21:11 -0400 Subject: - The ``Configurator.add_route`` method allowed two routes with the same route to be added without an intermediate ``config.commit()``. If you now receive a ``ConfigurationError`` at startup time that appears to be ``add_route`` related, you'll need to either a) ensure that all of your route names are unique or b) call ``config.commit()`` before adding a second route with the name of a previously added name or c) use a Configurator that works in ``autocommit`` mode. --- CHANGES.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index b9e645a38..403969fc0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -19,6 +19,17 @@ Behavior Changes event object) ensure no value already exists in the renderer globals dictionary before setting an overriding value. +Bug Fixes +--------- + +- The ``Configurator.add_route`` method allowed two routes with the same + route to be added without an intermediate ``config.commit()``. If you now + receive a ``ConfigurationError`` at startup time that appears to be + ``add_route`` related, you'll need to either a) ensure that all of your + route names are unique or b) call ``config.commit()`` before adding a + second route with the name of a previously added name or c) use a + Configurator that works in ``autocommit`` mode. + 1.1b1 (2011-07-10) ================== -- cgit v1.2.3 From aec6b29b42ad2acf0c9febd884ae9db1316022c5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 12 Jul 2011 19:52:26 -0400 Subject: - The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` scaffolds inappropriately used ``DBSession.rollback()`` instead of ``transaction.abort()`` in one place. - Wiki2 (SQLAlchemy + URL Dispatch) tutorial ``models.initialize_sql`` didn't match the ``pyramid_routesalchemy`` scaffold function of the same name; it didn't get synchronized when it was changed in the scaffold. --- CHANGES.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 403969fc0..fd11a16d1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -30,6 +30,17 @@ Bug Fixes second route with the name of a previously added name or c) use a Configurator that works in ``autocommit`` mode. +- The ``pyramid_routesalchemy`` and ``pyramid_alchemy`` scaffolds + inappropriately used ``DBSession.rollback()`` instead of + ``transaction.abort()`` in one place. + +Documentation +------------- + +- Wiki2 (SQLAlchemy + URL Dispatch) tutorial ``models.initialize_sql`` didn't + match the ``pyramid_routesalchemy`` scaffold function of the same name; it + didn't get synchronized when it was changed in the scaffold. + 1.1b1 (2011-07-10) ================== -- cgit v1.2.3 From e573d4356ed0371f5ba34ff3ff396fefd2e55913 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 12 Jul 2011 20:56:53 -0400 Subject: - New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and new configuration file value ``prevent_http_cache``. These are synomymous and allow you to prevent HTTP cache headers from being set by Pyramid's ``http_cache`` machinery globally in a process. see the "Influencing HTTP Caching" section of the "View Configuration" narrative chapter and the detailed documentation for this setting in the "Environment Variables and Configuration Settings" narrative chapter. - New documentation section in View Configuration narrative chapter: "Influencing HTTP Caching". --- CHANGES.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index fd11a16d1..ea83827cc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,17 @@ Next Release ============ +Features +-------- + +- New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and new + configuration file value ``prevent_http_cache``. These are synomymous and + allow you to prevent HTTP cache headers from being set by Pyramid's + ``http_cache`` machinery globally in a process. see the "Influencing HTTP + Caching" section of the "View Configuration" narrative chapter and the + detailed documentation for this setting in the "Environment Variables and + Configuration Settings" narrative chapter. + Behavior Changes ---------------- @@ -41,6 +52,9 @@ Documentation match the ``pyramid_routesalchemy`` scaffold function of the same name; it didn't get synchronized when it was changed in the scaffold. +- New documentation section in View Configuration narrative chapter: + "Influencing HTTP Caching". + 1.1b1 (2011-07-10) ================== -- cgit v1.2.3 From d05117e9655e3619e66bfef86f40043fbcc61829 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 13 Jul 2011 00:41:59 -0400 Subject: - We now clear ``request.response`` before we invoke an exception view; an exception view will be working with a request.response that has not been touched by any code prior to the exception. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index ea83827cc..21bea6572 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -45,6 +45,10 @@ Bug Fixes inappropriately used ``DBSession.rollback()`` instead of ``transaction.abort()`` in one place. +- We now clear ``request.response`` before we invoke an exception view; an + exception view will be working with a request.response that has not been + touched by any code prior to the exception. + Documentation ------------- -- cgit v1.2.3 From 873d9be3a787793caeb66223d2bb68dbc1fc396e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 13 Jul 2011 01:54:03 -0400 Subject: - Views associated with routes with spaces in the route name may not have been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4 and better. Closes #232. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 21bea6572..71491cb9b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -49,6 +49,10 @@ Bug Fixes exception view will be working with a request.response that has not been touched by any code prior to the exception. +- Views associated with routes with spaces in the route name may not have + been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4 + and better. + Documentation ------------- -- cgit v1.2.3 From d4ccb85f76f38400eaf90b40ccbc56b017e3a6bd Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 13 Jul 2011 03:34:05 -0400 Subject: prep for 1.1b2 --- CHANGES.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 71491cb9b..c2c0cc86a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ -Next Release -============ +1.1b2 (2011-07-13) +================== Features -------- @@ -51,7 +51,7 @@ Bug Fixes - Views associated with routes with spaces in the route name may not have been looked up correctly when using Pyramid with ``zope.interface`` 3.6.4 - and better. + and better. See https://github.com/Pylons/pyramid/issues/232. Documentation ------------- -- cgit v1.2.3 From 2ad827b4c67111f76e9c2fb54d082a50eb2b4c23 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 13 Jul 2011 18:31:41 -0400 Subject: - Fix corner case to ease semifunctional testing of views: create a new rendererinfo to clear out old registry on a rescan. See https://github.com/Pylons/pyramid/pull/234. Closes #234. --- CHANGES.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index c2c0cc86a..cd9f42dd9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,13 @@ +Next release +============ + +Features +-------- + +- Fix corner case to ease semifunctional testing of views: create a new + rendererinfo to clear out old registry on a rescan. See + https://github.com/Pylons/pyramid/pull/234. + 1.1b2 (2011-07-13) ================== -- cgit v1.2.3 From 56d0fe4a9f97daa4d5fd0c28ea83c6ef32856b3d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 14 Jul 2011 01:13:27 -0400 Subject: - New API class: ``pyramid.static.static_view``. This supersedes the deprecated ``pyramid.view.static`` class. ``pyramid.satic.static_view`` by default serves up documents as the result of the request's ``path_info``, attribute rather than it's ``subpath`` attribute (the inverse was true of ``pyramid.view.static``, and still is). ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when you don't want the static view to behave like the older deprecated version. - The ``pyramid.view.static`` class has been deprecated in favor of the newer ``pyramid.static.static_view`` class. A deprecation warning is raised when it is used. You should replace it with a reference to ``pyramid.static.static_view`` with the ``use_subpath=True`` argument. --- CHANGES.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index cd9f42dd9..d898c5ca6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,22 @@ Features rendererinfo to clear out old registry on a rescan. See https://github.com/Pylons/pyramid/pull/234. +- New API class: ``pyramid.static.static_view``. This supersedes the + deprecated ``pyramid.view.static`` class. ``pyramid.satic.static_view`` by + default serves up documents as the result of the request's ``path_info``, + attribute rather than it's ``subpath`` attribute (the inverse was true of + ``pyramid.view.static``, and still is). ``pyramid.static.static_view`` + exposes a ``use_subpath`` flag for use when you don't want the static view + to behave like the older deprecated version. + +Deprecations +------------ + +- The ``pyramid.view.static`` class has been deprecated in favor of the newer + ``pyramid.static.static_view`` class. A deprecation warning is raised when + it is used. You should replace it with a reference to + ``pyramid.static.static_view`` with the ``use_subpath=True`` argument. + 1.1b2 (2011-07-13) ================== -- cgit v1.2.3 From 100a571ebbbe7b9f7143ac6015a1b870191683d5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 14 Jul 2011 01:15:40 -0400 Subject: forgot to change whatsnew --- CHANGES.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index d898c5ca6..f1c153f3f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,12 +9,12 @@ Features https://github.com/Pylons/pyramid/pull/234. - New API class: ``pyramid.static.static_view``. This supersedes the - deprecated ``pyramid.view.static`` class. ``pyramid.satic.static_view`` by - default serves up documents as the result of the request's ``path_info``, - attribute rather than it's ``subpath`` attribute (the inverse was true of - ``pyramid.view.static``, and still is). ``pyramid.static.static_view`` - exposes a ``use_subpath`` flag for use when you don't want the static view - to behave like the older deprecated version. + deprecated ``pyramid.view.static`` class. ``pyramid.static.static_view`` + by default serves up documents as the result of the request's + ``path_info``, attribute rather than it's ``subpath`` attribute (the + inverse was true of ``pyramid.view.static``, and still is). + ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when + you don't want the static view to behave like the older deprecated version. Deprecations ------------ -- cgit v1.2.3 From 10408c799257d6727c968d63cf439b1ebfbfd335 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 14 Jul 2011 01:18:46 -0400 Subject: typo --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index f1c153f3f..1a0573278 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,7 +14,7 @@ Features ``path_info``, attribute rather than it's ``subpath`` attribute (the inverse was true of ``pyramid.view.static``, and still is). ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when - you don't want the static view to behave like the older deprecated version. + you want the static view to behave like the older deprecated version. Deprecations ------------ -- cgit v1.2.3 From 5b5cd6fa80421b594fa14a75f3daf6a5703f1898 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 14 Jul 2011 17:35:00 -0400 Subject: - Without a mo-file loaded for the combination of domain/locale, ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale combination raised an inscrutable "translations object has no attr 'plural' error. Now, instead it "works" (it uses a germanic pluralization by default). This is not the "right" thing really (it's nonsensical to try to pluralize something without translations for that locale/domain available), but it matches the behavior of ``pyramid.i18n.Localizer.translate`` so it's at least consistent; see https://github.com/Pylons/pyramid/issues/235. Closes #235. --- CHANGES.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 1a0573278..02c2da33d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,6 +24,18 @@ Deprecations it is used. You should replace it with a reference to ``pyramid.static.static_view`` with the ``use_subpath=True`` argument. +Bug Fixes +--------- + +- Without a mo-file loaded for the combination of domain/locale, + ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale + combination raised an inscrutable "translations object has no attr 'plural' + error. Now, instead it "works" (it uses a germanic pluralization by + default). This is not the "right" thing really (it's nonsensical to try to + pluralize something without translations for that locale/domain available), + but it matches the behavior of ``pyramid.i18n.Localizer.translate`` so it's + at least consistent; see https://github.com/Pylons/pyramid/issues/235. + 1.1b2 (2011-07-13) ================== -- cgit v1.2.3 From acc2d3ade4f5016ffd2f76923d3f56310b2ba577 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 14 Jul 2011 17:36:35 -0400 Subject: typo --- CHANGES.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 02c2da33d..bc906772d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -29,12 +29,12 @@ Bug Fixes - Without a mo-file loaded for the combination of domain/locale, ``pyramid.i18n.Localizer.pluralize`` run using that domain/locale - combination raised an inscrutable "translations object has no attr 'plural' - error. Now, instead it "works" (it uses a germanic pluralization by - default). This is not the "right" thing really (it's nonsensical to try to - pluralize something without translations for that locale/domain available), - but it matches the behavior of ``pyramid.i18n.Localizer.translate`` so it's - at least consistent; see https://github.com/Pylons/pyramid/issues/235. + combination raised an inscrutable "translations object has no attr + 'plural'" error. Now, instead it "works" (it uses a germanic pluralization + by default). It's nonsensical to try to pluralize something without + translations for that locale/domain available, but this behavior matches + the behavior of ``pyramid.i18n.Localizer.translate`` so it's at least + consistent; see https://github.com/Pylons/pyramid/issues/235. 1.1b2 (2011-07-13) ================== -- cgit v1.2.3 From c515d77de5b2f62727251ebc32d1292e67811771 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 15 Jul 2011 10:13:07 -0400 Subject: - get_root2 -> prepare - change prepare return value to a dict, and return the registry, request, etc - various docs and changelog entries. --- CHANGES.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index bc906772d..0e1f67cdc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -16,6 +16,39 @@ Features ``pyramid.static.static_view`` exposes a ``use_subpath`` flag for use when you want the static view to behave like the older deprecated version. +- A new API function ``pyramid.paster.bootstrap`` has been added to make + writing scripts that bootstrap a Pyramid environment easier, e.g.:: + + from pyramid.paster import bootstrap + info = bootstrap('/path/to/my/development.ini') + request = info['request'] + print request.route_url('myroute') + +- A new API function ``pyramid.scripting.prepare`` has been added. It is a + lower-level analogue of ``pyramid.paster.boostrap`` that accepts a request + and a registry instead of a config file argument, and is used for the same + purpose:: + + from pyramid.scripting import prepare + info = prepare(registry=myregistry) + request = info['request'] + print request.route_url('myroute') + +- A new API function ``pyramid.scripting.make_request`` has been added. The + resulting request will have a ``registry`` attribute. It is meant to be + used in conjunction with ``pyramid.scripting.prepare`` and/or + ``pyramid.paster.bootstrap`` (both of which accept a request as an + argument):: + + from pyramid.scripting import make_request + request = make_request('/') + +- New API attribute ``pyramid.config.global_registries`` is an iterable + object that contains references to every Pyramid registry loaded into the + current process via ``pyramid.config.Configurator.make_app``. It also has + a ``last`` attribute containing the last registry loaded. This is used by + the scripting machinery, and is available for introspection. + Deprecations ------------ -- cgit v1.2.3 From 999d44cf53e2213be8df881c2b407986b462c79c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 15 Jul 2011 10:40:35 -0400 Subject: prep for 1.1b3 --- CHANGES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 0e1f67cdc..00ac78835 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ -Next release -============ +1.1b3 (2011-07-15) +================== Features -------- -- cgit v1.2.3 From 5fb458c0dd70096e5d619e42992390bb1af071e1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 16 Jul 2011 01:08:43 -0400 Subject: - Added a section entitled "Writing a Script" to the "Command-Line Pyramid" chapter. --- CHANGES.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 00ac78835..afbc12747 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,12 @@ +Next release +============ + +Documentation +------------- + +- Added a section entitled "Writing a Script" to the "Command-Line Pyramid" + chapter. + 1.1b3 (2011-07-15) ================== -- cgit v1.2.3 From 4b3ba9a09ba5491b6752315a9c68189f3a9d1780 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 16 Jul 2011 16:47:59 -0400 Subject: - Omit custom environ variables when rendering a custom exception template in ``pyramid.httpexceptions.WSGIHTTPException._set_default_attrs``; stringifying thse may trigger code that should not be executed; see https://github.com/Pylons/pyramid/issues/239 Closes #239 --- CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index afbc12747..e8fce9c8d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,14 @@ Documentation - Added a section entitled "Writing a Script" to the "Command-Line Pyramid" chapter. +Bug Fixes +--------- + +- Omit custom environ variables when rendering a custom exception template in + ``pyramid.httpexceptions.WSGIHTTPException._set_default_attrs``; + stringifying thse may trigger code that should not be executed; see + https://github.com/Pylons/pyramid/issues/239 + 1.1b3 (2011-07-15) ================== -- cgit v1.2.3 From f06ce6f0dad47bd9b804b17b04035252fdd7868e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 16 Jul 2011 20:05:35 -0400 Subject: add note about removing make_request --- CHANGES.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index e8fce9c8d..fd10a7219 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,13 @@ Documentation - Added a section entitled "Writing a Script" to the "Command-Line Pyramid" chapter. +Backwards Incompatibilities +--------------------------- + +- We added the ``pyramid.scripting.make_request`` API too hastily in 1.1b3. + It has been removed. Sorry for any inconvenience. Use the + ``pyramid.request.Request.blank`` API instead. + Bug Fixes --------- -- cgit v1.2.3 From 95df4223bfd0306a9296214c30ca14dccdd8c6c4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 16 Jul 2011 20:07:52 -0400 Subject: mention paster pshell using prepare --- CHANGES.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index fd10a7219..895713767 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,15 @@ Backwards Incompatibilities It has been removed. Sorry for any inconvenience. Use the ``pyramid.request.Request.blank`` API instead. +Features +-------- + +- The ``paster pshell`` command now under the hood uses + ``pyramid.scripting.prepare``, which makes it possible to supply an + ``.ini`` file without naming the "right" section in the file that points at + the actual Pyramid application. Instead, you can generally just run + ``paster pshell development.ini`` and it will do mostly the right thing. + Bug Fixes --------- -- cgit v1.2.3 From 9c5b83710cd86ef4ddeae49a37518d869e504308 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 16 Jul 2011 20:09:05 -0400 Subject: mention paster pshell using bootstrap --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 895713767..5a709b332 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -18,7 +18,7 @@ Features -------- - The ``paster pshell`` command now under the hood uses - ``pyramid.scripting.prepare``, which makes it possible to supply an + ``pyramid.paster.bootstrap``, which makes it possible to supply an ``.ini`` file without naming the "right" section in the file that points at the actual Pyramid application. Instead, you can generally just run ``paster pshell development.ini`` and it will do mostly the right thing. -- cgit v1.2.3 From af056046970db9b1d3732f4c5978fcb3fb863d1f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 16 Jul 2011 21:23:07 -0400 Subject: - Change paster pviews and paster proutes to use bootstrap. --- CHANGES.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5a709b332..9edeb63c9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -17,11 +17,13 @@ Backwards Incompatibilities Features -------- -- The ``paster pshell`` command now under the hood uses - ``pyramid.paster.bootstrap``, which makes it possible to supply an - ``.ini`` file without naming the "right" section in the file that points at - the actual Pyramid application. Instead, you can generally just run - ``paster pshell development.ini`` and it will do mostly the right thing. +- The ``paster pshell``, ``paster pviews``, and ``paster proutes`` commands + each now under the hood uses ``pyramid.paster.bootstrap``, which makes it + possible to supply an ``.ini`` file without naming the "right" section in + the file that points at the actual Pyramid application. Instead, you can + generally just run ``paster {pshell|proutes|pviews} development.ini`` and + it will do mostly the right thing. + Bug Fixes --------- -- cgit v1.2.3 From 40c643e07e1a5eeb48e86070cd0ffbd998899669 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 18 Jul 2011 02:59:50 -0400 Subject: prep for 1.1b4 --- CHANGES.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 9edeb63c9..1b85d39be 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ -Next release -============ +1.1b4 (2011-07-18) +================== Documentation ------------- @@ -24,7 +24,6 @@ Features generally just run ``paster {pshell|proutes|pviews} development.ini`` and it will do mostly the right thing. - Bug Fixes --------- -- cgit v1.2.3 From ead3c7e169dbac62f97cbaffc15f3c40430b70ea Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 19 Jul 2011 08:26:05 -0400 Subject: - Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial. --- CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 1b85d39be..117204e11 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,11 @@ +Next release +============ + +Documentation +------------- + +- Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial. + 1.1b4 (2011-07-18) ================== -- cgit v1.2.3 From 8cb68208d42899b50025418812bb339f578d553f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 20 Jul 2011 07:16:14 -0400 Subject: - Reordered chapters in narrative section for better new user friendliness. - Added more indexing markers to sections in documentation. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 117204e11..09e6139cc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,10 @@ Documentation - Fixed two typos in wiki2 (SQLA + URL Dispatch) tutorial. +- Reordered chapters in narrative section for better new user friendliness. + +- Added more indexing markers to sections in documentation. + 1.1b4 (2011-07-18) ================== -- cgit v1.2.3 From e7cb93e1c07fb59a523ff8e79732787a3f4ae213 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Jul 2011 02:19:16 -0400 Subject: - Remove ``compat`` code that served only the purpose of providing backwards compatibility with Python 2.4. --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 09e6139cc..609f62bd3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,12 @@ Next release ============ +Internals +--------- + +- Remove ``compat`` code that served only the purpose of providing backwards + compatibility with Python 2.4. + Documentation ------------- -- cgit v1.2.3 From 73c0aee5571bbdd7273033eda3a798d5597a76af Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Jul 2011 19:59:36 -0400 Subject: - Add a deprecation warning for non-API function ``pyramid.renderers.renderer_from_name`` which has seen use in the wild. - Add a ``clone`` method to ``pyramid.renderers.RendererHelper`` for use by the ``pyramid.view.view_config`` decorator. --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 609f62bd3..bb5828811 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,12 @@ Internals - Remove ``compat`` code that served only the purpose of providing backwards compatibility with Python 2.4. +- Add a deprecation warning for non-API function + ``pyramid.renderers.renderer_from_name`` which has seen use in the wild. + +- Add a ``clone`` method to ``pyramid.renderers.RendererHelper`` for use by + the ``pyramid.view.view_config`` decorator. + Documentation ------------- -- cgit v1.2.3 From aa2fe1b0a02ba4edde4d285ec0a5a6ec545b7fec Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Jul 2011 22:02:37 -0400 Subject: - Added the ``pyramid.renderers.null_renderer`` object as an API. The null renderer is an object that can be used in advanced integration cases as input to the view configuration ``renderer=`` argument. When the null renderer is used as a view renderer argument, Pyramid avoids converting the view callable result into a Response object. This is useful if you want to reuse the view configuration and lookup machinery outside the context of its use by the Pyramid router. This feature was added for consumption by the ``pyramid_rpc`` package, which uses view configuration and lookup outside the context of a router in exactly this way. ``pyramid_rpc`` has been broken under 1.1 since 1.1b1; adding it allows us to make it work again. --- CHANGES.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index bb5828811..5e2fb2970 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,21 @@ Next release ============ +Features +-------- + +- Added the ``pyramid.renderers.null_renderer`` object as an API. The null + renderer is an object that can be used in advanced integration cases as + input to the view configuration ``renderer=`` argument. When the null + renderer is used as a view renderer argument, Pyramid avoids converting the + view callable result into a Response object. This is useful if you want to + reuse the view configuration and lookup machinery outside the context of + its use by the Pyramid router. This feature was added for consumption by + the ``pyramid_rpc`` package, which uses view configuration and lookup + outside the context of a router in exactly this way. ``pyramid_rpc`` has + been broken under 1.1 since 1.1b1; adding it allows us to make it work + again. + Internals --------- -- cgit v1.2.3 From 39e88a1f2903f840feeff77e572c7bf3efebb875 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Jul 2011 23:08:31 -0400 Subject: - Change all scaffolding templates that point to docs.pylonsproject.org to use ``/projects/pyramid/current`` rather than ``/projects/pyramid/dev``. --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5e2fb2970..912c198bb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -16,6 +16,9 @@ Features been broken under 1.1 since 1.1b1; adding it allows us to make it work again. +- Change all scaffolding templates that point to docs.pylonsproject.org to + use ``/projects/pyramid/current`` rather than ``/projects/pyramid/dev``. + Internals --------- -- cgit v1.2.3 From 8c03444dd5d80adaf65e30ebdabf1e6dde644965 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 21 Jul 2011 23:32:50 -0400 Subject: prep for 1.1; gather contributors --- CHANGES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 912c198bb..a2ad1f720 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ -Next release -============ +1.1 (2011-07-22) +================ Features -------- -- cgit v1.2.3 From 9a66aa09a8a773f67da59642a6642f1a3240c254 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 23 Jul 2011 13:40:24 -0400 Subject: - The ``pyramid.events.BeforeRender`` event now has an attribute named ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. --- CHANGES.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index a2ad1f720..57ab76e46 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,13 @@ +Next release +============ + +Features +-------- + +- The ``pyramid.events.BeforeRender`` event now has an attribute named + ``rendering_val``. This can be used to introspect the value returned by a + view in a BeforeRender subscriber. + 1.1 (2011-07-22) ================ -- cgit v1.2.3 From b723792bfc43dc3d4446837c48d78c9258697e6d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 23 Jul 2011 19:57:34 -0400 Subject: - New method: ``pyramid.request.Request.add_view_mapper``. A view wrapper is used to wrap the found view callable before it is called by Pyramid's router. This is a feature usually only used by framework extensions, to provide, for example, view timing support. A view wrapper factory must be a callable which accepts three arguments: ``view_callable``, ``request``, and ``exc``. It must return a view callable. The view callable returned by the factory must implement the ``context, request`` view callable calling convention. For example:: import time def wrapper_factory(view_callable, request, exc): def wrapper(context, request): start = time.time() result = view_callable(context, request) end = time.time() request.view_timing = end - start return result return wrapper The ``view_callable`` argument to the factory will be the view callable found by Pyramid via view lookup. The ``request`` argument to the factory will be the current request. The ``exc`` argument to the factory will be an Exception object if the found view is an exception view; it will be ``None`` otherwise. View wrappers only last for the duration of a single request. You can add such a factory for every request by using the ``pyramid.events.NewRequest`` subscriber:: from pyramid.events import subscriber, NewRequest @subscriber(NewRequest) def newrequest(event): event.request.add_view_wrapper(wrapper_factory) If more than one view wrapper is registered during a single request, a 'later' view wrapper factory will be called with the result of its directly former view wrapper factory as its ``view_callable`` argument; this chain will be returned to Pyramid as a single view callable. --- CHANGES.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 57ab76e46..666b89b96 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,50 @@ Features ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. +- New method: ``pyramid.request.Request.add_view_mapper``. A view wrapper is + used to wrap the found view callable before it is called by Pyramid's + router. This is a feature usually only used by framework extensions, to + provide, for example, view timing support. + + A view wrapper factory must be a callable which accepts three arguments: + ``view_callable``, ``request``, and ``exc``. It must return a view + callable. The view callable returned by the factory must implement the + ``context, request`` view callable calling convention. For example:: + + import time + + def wrapper_factory(view_callable, request, exc): + def wrapper(context, request): + start = time.time() + result = view_callable(context, request) + end = time.time() + request.view_timing = end - start + return result + return wrapper + + The ``view_callable`` argument to the factory will be the view callable + found by Pyramid via view lookup. The ``request`` argument to the factory + will be the current request. The ``exc`` argument to the factory will be + an Exception object if the found view is an exception view; it will be + ``None`` otherwise. + + View wrappers only last for the duration of a single request. You can add + such a factory for every request by using the + ``pyramid.events.NewRequest`` subscriber:: + + from pyramid.events import subscriber, NewRequest + + @subscriber(NewRequest) + def newrequest(event): + event.request.add_view_wrapper(wrapper_factory) + + If more than one view wrapper is registered during a single request, + a 'later' view wrapper factory will be called with the result of its + directly former view wrapper factory as its ``view_callable`` + argument; this chain will be returned to Pyramid as a single view + callable. + + 1.1 (2011-07-22) ================ -- cgit v1.2.3 From ac77e365c8269953a5dde89157d7468529ee7432 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 23 Jul 2011 19:58:55 -0400 Subject: typo --- CHANGES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 666b89b96..3c232d880 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,8 +8,8 @@ Features ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. -- New method: ``pyramid.request.Request.add_view_mapper``. A view wrapper is - used to wrap the found view callable before it is called by Pyramid's +- New method: ``pyramid.request.Request.add_view_wrapper``. A view wrapper + is used to wrap the found view callable before it is called by Pyramid's router. This is a feature usually only used by framework extensions, to provide, for example, view timing support. -- cgit v1.2.3 From af2323bcb169653dd2d76d7c40909fd881041beb Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 24 Jul 2011 01:01:38 -0400 Subject: first cut --- CHANGES.txt | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 3c232d880..b1979347a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -51,6 +51,65 @@ Features argument; this chain will be returned to Pyramid as a single view callable. +- New configurator directive: + ``pyramid.config.Configurator.add_request_handler``. This directive adds + a request handler factory. + + A request handler factory is used to wrap the Pyramid router's primary + request handling function. This is a feature usually only used by + framework extensions, to provide, for example, view timing support and as + a convenient place to hang bookkeeping code that examines exceptions + before they are returned to the server. + + A request handler factory (passed as ``handler_factory``) must be a + callable which accepts two arguments: ``handler`` and ``registry``. + ``handler`` will be the request handler being wrapped. ``registry`` will + be the Pyramid application registry represented by this Configurator. A + request handler factory must return a request handler when it is called. + + A request handler accepts a request object and returns a response object. + + Here's an example of creating both a handler factory and a handler, and + registering the handler factory: + + .. code-block:: python + + import time + + def timing_handler_factory(handler, registry): + if registry.settings['do_timing']: + # if timing support is enabled, return a wrapper + def timing_handler(request): + start = time.time() + try: + response = handler(request) + finally: + end = time.time() + print: 'The request took %s seconds' % (end - start) + return response + return timing_handler + # if timing support is not enabled, return the original handler + return handler + + config.add_request_handler(timing_handler_factory, 'timing') + + The ``request`` argument to the handler will be the request created by + Pyramid's router when it receives a WSGI request. + + If more than one request handler factory is registered into a single + configuration, the request handlers will be chained together. The first + request handler factory added (in code execution order) will be called + with the default Pyramid request handler, the second handler factory added + will be called with the result of the first handler factory, ad + infinitum. The Pyramid router will use the outermost wrapper in this chain + (which is a bit like a WSGI middleware "pipeline") as its handler + function. + + The ``name`` argument to this function is required. The name is used as a + key for conflict detection. No two request handler factories may share + the same name in the same configuration (unless + automatic_conflict_resolution is able to resolve the conflict or + this is an autocommitting configurator). 1.1 (2011-07-22) ================ -- cgit v1.2.3 From 6434998267a4930fd9175df06b9a07d83937b71d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 24 Jul 2011 01:05:56 -0400 Subject: back this feature out; we'll try a different approach --- CHANGES.txt | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 3c232d880..57ab76e46 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,50 +8,6 @@ Features ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. -- New method: ``pyramid.request.Request.add_view_wrapper``. A view wrapper - is used to wrap the found view callable before it is called by Pyramid's - router. This is a feature usually only used by framework extensions, to - provide, for example, view timing support. - - A view wrapper factory must be a callable which accepts three arguments: - ``view_callable``, ``request``, and ``exc``. It must return a view - callable. The view callable returned by the factory must implement the - ``context, request`` view callable calling convention. For example:: - - import time - - def wrapper_factory(view_callable, request, exc): - def wrapper(context, request): - start = time.time() - result = view_callable(context, request) - end = time.time() - request.view_timing = end - start - return result - return wrapper - - The ``view_callable`` argument to the factory will be the view callable - found by Pyramid via view lookup. The ``request`` argument to the factory - will be the current request. The ``exc`` argument to the factory will be - an Exception object if the found view is an exception view; it will be - ``None`` otherwise. - - View wrappers only last for the duration of a single request. You can add - such a factory for every request by using the - ``pyramid.events.NewRequest`` subscriber:: - - from pyramid.events import subscriber, NewRequest - - @subscriber(NewRequest) - def newrequest(event): - event.request.add_view_wrapper(wrapper_factory) - - If more than one view wrapper is registered during a single request, - a 'later' view wrapper factory will be called with the result of its - directly former view wrapper factory as its ``view_callable`` - argument; this chain will be returned to Pyramid as a single view - callable. - - 1.1 (2011-07-22) ================ -- cgit v1.2.3 From 3a80546633185b64390b7779bab459a7e58f22c4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 24 Jul 2011 02:08:51 -0400 Subject: - The Pyramid debug logger now uses the standard logging configuration (usually set up by Paste as part of startup). This means that output from e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the normal logging channels. The logger name of the debug logger will be the package name of the *caller* of the Configurator's constructor. - If a string is passed as the ``debug_logger`` parameter to a Configurator, that string is considered to be the name of a global Python logger rather than a dotted name to an instance of a logger. --- CHANGES.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index c9c95fd7f..e14d4629b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,7 +8,7 @@ Features ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. -- New configurator directive: +- New configurator directive:^ ``pyramid.config.Configurator.add_request_handler``. This directive adds a request handler factory. @@ -66,6 +66,19 @@ Features same name in the same configuration (unless automatic_conflict_resolution is able to resolve the conflict or this is an autocommitting configurator). +- The Pyramid debug logger now uses the standard logging configuration + (usually set up by Paste as part of startup). This means that output from + e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the + normal logging channels. The logger name of the debug logger will be the + package name of the *caller* of the Configurator's constructor. + +Backwards Incompatibilities +--------------------------- + +- If a string is passed as the ``debug_logger`` parameter to a Configurator, + that string is considered to be the name of a global Python logger rather + than a dotted name to an instance of a logger. + 1.1 (2011-07-22) ================ -- cgit v1.2.3 From f91e0c8bebe0d18c3e65850515b8b1cb7fdbd335 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 24 Jul 2011 02:09:43 -0400 Subject: stray hat --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index e14d4629b..2bc462008 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,7 +8,7 @@ Features ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. -- New configurator directive:^ +- New configurator directive: ``pyramid.config.Configurator.add_request_handler``. This directive adds a request handler factory. -- cgit v1.2.3 From 1f901ab75c55bafc9c233c3c9588cc1bd92d9d66 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 28 Jul 2011 17:06:29 -0400 Subject: add some edits to the docs for response_adapter decorator; fix renderings --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 2bc462008..5ca9e9379 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Next release Features -------- +- Added a decorator-based way to configure a response adapter: + ``pyramid.response.response_adapter``. This decorator has the same use as + ``pyramid.config.Configurator.add_response_adapter`` but it's declarative. + - The ``pyramid.events.BeforeRender`` event now has an attribute named ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. -- cgit v1.2.3 From ef6f6b8ce83288678db81cf528fbeb03db0b650e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 30 Jul 2011 04:33:42 -0400 Subject: note prefixes --- CHANGES.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 5ca9e9379..1f6da0d8b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -76,6 +76,16 @@ Features normal logging channels. The logger name of the debug logger will be the package name of the *caller* of the Configurator's constructor. +Deprecations +------------ + +- All Pyramid-related deployment settings (e.g. ``debug_all``, + ``debug_notfound``) are now meant to be prefixed with the prefix + ``pyramid.``. For example: ``debug_all`` -> ``pyramid.debug_all``. The + old non-prefixed settings will continue to work indefinitely but supplying + them may print a deprecation warning. All scaffolds and tutorials have + been changed to use prefixed settings. + Backwards Incompatibilities --------------------------- -- cgit v1.2.3 From 95a3791409f4a936c47e7018e75f14fc3b701380 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 31 Jul 2011 03:57:06 -0400 Subject: - A new attribute is available on request objects: ``exc_info``. Its value will be ``None`` until an exception is caught by the Pyramid router, after which it will be the result of ``sys.exc_info()``. --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 1f6da0d8b..c94ecb800 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -76,6 +76,10 @@ Features normal logging channels. The logger name of the debug logger will be the package name of the *caller* of the Configurator's constructor. +- A new attribute is available on request objects: ``exc_info``. Its value + will be ``None`` until an exception is caught by the Pyramid router, after + which it will be the result of ``sys.exc_info()``. + Deprecations ------------ -- cgit v1.2.3 From 6b2a6210dcda54d81e6e827aed74379f579a2810 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 6 Aug 2011 19:41:40 -0400 Subject: improve changes docs --- CHANGES.txt | 86 +++++++++++++++++++++---------------------------------------- 1 file changed, 29 insertions(+), 57 deletions(-) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index c94ecb800..b6f33715e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,63 +12,19 @@ Features ``rendering_val``. This can be used to introspect the value returned by a view in a BeforeRender subscriber. -- New configurator directive: - ``pyramid.config.Configurator.add_request_handler``. This directive adds - a request handler factory. - - A request handler factory is used to wrap the Pyramid router's primary - request handling function. This is a feature may be used by framework - extensions, to provide, for example, view timing support and as a - convenient place to hang bookkeeping code that examines exceptions before - they are returned to the server. - - A request handler factory (passed as ``handler_factory``) must be a - callable which accepts two arguments: ``handler`` and ``registry``. - ``handler`` will be the request handler being wrapped. ``registry`` will - be the Pyramid application registry represented by this Configurator. A - request handler factory must return a request handler when it is called. - - A request handler accepts a request object and returns a response object. - - Here's an example of creating both a handler factory and a handler, and - registering the handler factory: - - .. code-block:: python - - import time - - def timing_handler_factory(handler, registry): - if registry.settings['do_timing']: - # if timing support is enabled, return a wrapper - def timing_handler(request): - start = time.time() - try: - response = handler(request) - finally: - end = time.time() - print: 'The request took %s seconds' % (end - start) - return response - return timing_handler - # if timing support is not enabled, return the original handler - return handler - - config.add_request_handler(timing_handler_factory, 'timing') - - The ``request`` argument to the handler will be the request created by - Pyramid's router when it receives a WSGI request. - - If more than one request handler factory is registered into a single - configuration, the request handlers will be chained together. The first - request handler factory added (in code execution order) will be called with - the default Pyramid request handler, the second handler factory added will - be called with the result of the first handler factory, ad infinitum. The - Pyramid router will use the outermost wrapper in this chain (which is a bit - like a WSGI middleware "pipeline") as its handler function. - - The ``name`` argument to this function is required. The name is used as a - key for conflict detection. No two request handler factories may share the - same name in the same configuration (unless automatic_conflict_resolution - is able to resolve the conflict or this is an autocommitting configurator). +- New configurator directive: ``pyramid.config.Configurator.add_tween``. + This directive adds a "tween". A "tween" is used to wrap the Pyramid + router's primary request handling function. This is a feature may be used + by Pyramid framework extensions, to provide, for example, view timing + support and as a convenient place to hang bookkeeping code. + + Tweens are further described in the narrative docs section in the Hooks + chapter, named "Registering Tweens". + +- New paster command ``paster ptweens``, which prints the current "tween" + configuration for an application. See the section entitled "Displaying + Tweens" in the Command-Line Pyramid chapter of the narrative documentation + for more info. - The Pyramid debug logger now uses the standard logging configuration (usually set up by Paste as part of startup). This means that output from @@ -80,6 +36,12 @@ Features will be ``None`` until an exception is caught by the Pyramid router, after which it will be the result of ``sys.exc_info()``. +Internal +-------- + +- The Pyramid "exception view" machinery is now implemented as a "tween" + (``pyramid.tweens.excview_tween_factory``). + Deprecations ------------ @@ -97,6 +59,16 @@ Backwards Incompatibilities that string is considered to be the name of a global Python logger rather than a dotted name to an instance of a logger. +Documentation +------------- + +- Added a new module to the API docs: ``pyramid.tweens``. + +- Added a "Registering Tweens" section to the "Hooks" narrative chapter. + +- Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative + chapter. + 1.1 (2011-07-22) ================ -- cgit v1.2.3 From 1e88dbb96c895f2978fb440221bec367d7ecdb0a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 10 Aug 2011 00:34:13 -0400 Subject: add note about NO_PERMISSION_REQUIRED --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index b6f33715e..87b8ca53f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,12 @@ Next release Features -------- +- Added a ``pyramid.security.NO_PERMISSION_REQUIRED`` constant for use in + ``permission=`` statements to view configuration. This constant has a + value of the string ``__no_permission_required__``. This string value was + previously referred to in documentation; now the documentation uses the + constant. + - Added a decorator-based way to configure a response adapter: ``pyramid.response.response_adapter``. This decorator has the same use as ``pyramid.config.Configurator.add_response_adapter`` but it's declarative. -- cgit v1.2.3 From 1939d00839e805f44680512b7952f4c1aff32a7c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 10 Aug 2011 14:30:00 -0400 Subject: - Fixed an issue with the default renderer not working at certain times. See https://github.com/Pylons/pyramid/issues/249 Closes #249. --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index 87b8ca53f..208662150 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -75,6 +75,12 @@ Documentation - Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative chapter. +Bug Fixes +--------- + +- Fixed an issue with the default renderer not working at certain times. See + https://github.com/Pylons/pyramid/issues/249 + 1.1 (2011-07-22) ================ -- cgit v1.2.3