From d83b3943474d2eb01b0fd8c1be31c50553fd4384 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 5 Dec 2011 01:41:04 -0500 Subject: add whatsnew-1.3; garden --- docs/whatsnew-1.3.rst | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 docs/whatsnew-1.3.rst (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst new file mode 100644 index 000000000..45b00cff2 --- /dev/null +++ b/docs/whatsnew-1.3.rst @@ -0,0 +1,139 @@ +What's New In Pyramid 1.3 +========================= + +This article explains the new features in :app:`Pyramid` version 1.3 as +compared to its predecessor, :app:`Pyramid` 1.2. It also documents backwards +incompatibilities between the two versions and deprecations added to +:app:`Pyramid` 1.3, as well as software dependency changes and notable +documentation additions. + +Major Feature Additions +----------------------- + +The major feature additions in Pyramid 1.3 follow. + +Python 3 Compatibility +~~~~~~~~~~~~~~~~~~~~~~ + +Pyramid is now Python 3 compatible. Python 3.2 or better is required. A new +:mod:`pyramid.compat` module was added which provides Python 2/3 straddling +support for Pyramid add-ons and development environments. + +Python 3 compatibility required dropping some package dependencies and +support for older Python versions and platforms. See the "Backwards +Incompatibilities" section below for more information. + +Introspection +~~~~~~~~~~~~~ + +A configuration introspection system was added; see +:ref:`using_introspection` and :ref:`introspection` for more information on +using the introspection system as a developer. + +A new release of the pyramid debug toolbar will provide an "Introspection" +panel that presents introspection information to a developer. + +New APIs were added to support introspection +:attr:`pyramid.registry.Introspectable`, +:attr:`pyramid.registry.noop_introspector`, +:attr:`pyramid.config.Configurator.introspector`, +:attr:`pyramid.config.Configurator.introspectable`, +:attr:`pyramid.registry.Registry.introspector`. + +Minor Feature Additions +----------------------- + +- A ``mako.directories`` setting is no longer required to use Mako templates + Rationale: Mako template renderers can be specified using an absolute asset + spec. An entire application can be written with such asset specs, + requiring no ordered lookup path. + +- ``bpython`` interpreter compatibility in ``pshell``. See + :ref:`ipython_or_bpython` for more information. + +- Added :func:`pyramid.paster.get_appsettings`` API function. This function + returns the settings defined within an ``[app:...]`` section in a + PasteDeploy ``ini`` file. + +- Added :func:`pyramid.paster.setup_logging` API function. This function + sets up Python logging according to the logging configuration in a + PasteDeploy ``ini`` file. + +- Configuration conflict reporting is reported in a more understandable way + ("Line 11 in file..." vs. a repr of a tuple of similar info). + +- Allow extra keyword arguments to be passed to the + :meth:`pyramid.config.Configurator.action` method. + +Backwards Incompatibilities +--------------------------- + +- Pyramid no longer runs on Python 2.5 (which includes the most recent + release of Jython and the Python 2.5 version of GAE as of this writing). + +- The ``paster`` command is no longer the documented way to create projects, + start the server, or run debugging commands. To create projects from + scaffolds, ``paster create`` is replaced by the ``pcreate`` console script. + To serve up a project, ``paster serve`` is replaced by the ``pserve`` + console script. New console scripts named ``pshell``, ``pviews``, + ``proutes``, and ``ptweens`` do what their ``paster `` + equivalents used to do. All relevant narrative documentation has been + updated. Rationale: the Paste and PasteScript packages do not run under + Python 3. + +- The default WSGI server run as the result of ``pserve`` from newly rendered + scaffolding is now the ``wsgiref`` WSGI server instead of the + ``paste.httpserver`` server. ``wsgiref``, unlike the server it replaced + (``paste.httpserver``) is not a production quality server. See + :ref:`alternate_wsgi_server` for information about how to use another WSGI + server in production. Rationale: Rationale: the Paste and PasteScript + packages do not run under Python 3. + +- The ``pshell`` command (see "paster pshell") no longer accepts a + ``--disable-ipython`` command-line argument. Instead, it accepts a ``-p`` + or ``--python-shell`` argument, which can be any of the values ``python``, + ``ipython`` or ``bpython``. + +Documentation Enhancements +-------------------------- + +- The :ref:`bfg_sql_wiki_tutorial` has been updated. It now uses + ``@view_config`` decorators and an explicit database population script. + +- Minor updates to the :ref:`bfg_wiki_tutorial`. + +- A narrative documentation chapter named :ref:`extconfig_narr` was added; it + describes how to add a custom :term:`configuration directive`, and how use + the :meth:`pyramid.config.Configurator.action` method within custom + directives. It also describes how to add :term:`introspectable` objects. + +- A narrative documentation chapter named :ref:`using_introspection` was + added. It describes how to query the introspection system. + +Dependency Changes +------------------ + +- Pyramid no longer depends on the ``zope.component`` package, except as a + testing dependency. + +- Pyramid now depends on the following package versions: + zope.interface>=3.8.0, WebOb>=1.2dev, repoze.lru>=0.4, + zope.deprecation>=3.5.0, translationstring>=0.4 for Python 3 compatibility + purposes. It also, as a testing dependency, depends on WebTest>=1.3.1 for + the same reason. + +- Pyramid no longer depends on the ``Paste`` or ``PasteScript`` packages. + These packages are not Python 3 compatible. + +Scaffolding Changes +------------------- + +- Rendered scaffolds have now been changed to be more relocatable (fewer + mentions of the package name within files in the package). + +- The ``routesalchemy`` scaffold has been renamed ``alchemy``, replacing the + older (traversal-based) ``alchemy`` scaffold (which has been retired). + +- The ``starter`` scaffold now uses URL dispatch by default. + + -- cgit v1.2.3 From e307fcd13a98ef5b60e6f48c5cebb703c35db31f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 5 Dec 2011 02:09:23 -0500 Subject: - Removed the ``pyramid.renderers.renderer_from_name`` function. It has been deprecated since Pyramid 1.0, and was never an API. --- docs/whatsnew-1.3.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 45b00cff2..b4ec96976 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -94,6 +94,9 @@ Backwards Incompatibilities or ``--python-shell`` argument, which can be any of the values ``python``, ``ipython`` or ``bpython``. +- Removed the ``pyramid.renderers.renderer_from_name`` function. It has been + deprecated since Pyramid 1.0, and was never an API. + Documentation Enhancements -------------------------- -- cgit v1.2.3 From b74abe0de69ef43cc416d61fbf3c0619b3314469 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 6 Dec 2011 02:13:12 -0500 Subject: garden --- docs/whatsnew-1.3.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index b4ec96976..44c55e208 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -97,6 +97,13 @@ Backwards Incompatibilities - Removed the ``pyramid.renderers.renderer_from_name`` function. It has been deprecated since Pyramid 1.0, and was never an API. +- To use ZCML with versions of Pyramid >= 1.3, you will need ``pyramid_zcml`` + version >= 0.8 and ``zope.configuration`` version >= 3.8.0. The + ``pyramid_zcml`` package version 0.8 is backwards compatible all the way to + Pyramid 1.0, so you won't be warned if you have older versions installed + and upgrade Pyramid itself "in-place"; it may simply break instead + (particularly if you use ZCML's ``includeOverrides`` directive). + Documentation Enhancements -------------------------- -- cgit v1.2.3 From 56df902d0a5bcd29a2b4c3dfafab9a09d6f0c29d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 8 Dec 2011 04:26:15 -0500 Subject: - New APIs: ``pyramid.path.AssetResolver`` and ``pyramid.path.DottedNameResolver``. The former can be used to resolve asset specifications, the latter can be used to resolve dotted names to modules or packages. --- docs/whatsnew-1.3.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 44c55e208..9bb10d1d0 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -43,6 +43,12 @@ New APIs were added to support introspection Minor Feature Additions ----------------------- +- New APIs: :class:`pyramid.path.AssetResolver` and + :class:`pyramid.path.DottedNameResolver`. The former can be used to + resolve an :term:`asset specification` to an API that can be used to read + the asset's data, the latter can be used to resolve a :term:`dotted Python + name` to a module or a package. + - A ``mako.directories`` setting is no longer required to use Mako templates Rationale: Mako template renderers can be specified using an absolute asset spec. An entire application can be written with such asset specs, -- cgit v1.2.3 From ce61d63871e554e2ce97953915a5df0b935e16a3 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 9 Dec 2011 04:06:54 -0500 Subject: garden --- docs/whatsnew-1.3.rst | 92 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 8 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 9bb10d1d0..7b485a725 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -15,9 +15,84 @@ The major feature additions in Pyramid 1.3 follow. Python 3 Compatibility ~~~~~~~~~~~~~~~~~~~~~~ -Pyramid is now Python 3 compatible. Python 3.2 or better is required. A new -:mod:`pyramid.compat` module was added which provides Python 2/3 straddling -support for Pyramid add-ons and development environments. +Pyramid is now Python 3 compatible. Python 3.2 or better is required. + +This feature required us to make some compromises. + +Pyramid no longer runs on Python 2.5. This includes the most recent release +of Jython and the Python 2.5 version of Google App Engine. We could not +easily "straddle" Python 2 and 3 versions and support Python 2 versions older +than Python 2.6. You will need Python 2.6 or better to run this version of +Pyramid. If you need to use Pyramid on Python 2.5, you should use the most +recent 1.2.X release fo Pyramid there. + +Though many Pyramid add-ons have releases which are already Python 3 +compatible (in particular ``pyramid_debugtoolbar``, ``pyramid_jinja2``, +``pyramid_exclog``, and ``pyramid_tm``), some are still known to work only +under Python 2. Likewise, some scaffolding dependencies (particularly ZODB) +do not yet work under Python +3. Please be patient as we gain full ecosystem support for Python 3. You +can see more details about ongoing porting efforts at +https://github.com/Pylons/pyramid/wiki/Python-3-Porting . + +The libraries named ``Paste`` and ``PasteScript`` which have been +dependencies of Pyramid since 1.0+ have not been ported to Python 3, and we +were unwilling to port and maintain them ourselves. As a result, we've had +to make some changes: + +- We've replaced the ``paster`` command with Pyramid-specific analogues. + +- We've made the default WSGI server the ``wsgiref`` server. + +Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application +using ``paster create``, like so:: + + $myvenv/bin/paster create -t pyramid_starter foo + +You're now instead required to create an application using ``pcreate`` like +so:: + + $myvenv/bin/pcreate -s starter foo + +Note that the names of available scaffolds have changed the and flags +supported by ``pcreate`` are different than those that were supported by +``paster create``. + +Instead of running a Pyramid project created via a scaffold using ``paster +serve``, as was done in Pyramid <= 1.2.X, you now must use the ``pserve`` +command:: + + $myvenv/bin/pserve development.ini + +The ``ini`` configuration file format supported by Pyramid has not changed. +As a result, Python 2-only users can install PasteScript manually and use +``paster serve`` and ``paster create`` instead if they like. However, using +``pserve`` and ``pcreate`` will work under both Python 2 and Python 3. + +Analogues of ``paster pshell``, ``paster pviews`` and ``paster ptweens`` also +exist under the respective console script names ``pshell``, ``pviews``, and +``ptweens``. + +We've replaced use of the Paste http server with the ``wsgiref`` server in +the scaffolds, so once you create a project from a scaffold, its +``development.ini`` and ``production.ini`` will have the following line:: + + use = egg:pyramid#wsgref + +Instead of this (which was the default in older versions):: + + use = egg:Paste#http + +Using ``wsgiref`` as the default WSGI server is purely a default to make it +possible to use the same scaffolding under Python 2 and Python 3; people +running Pyramid under Python 2 can still manually install ``Paste`` and use +the Paste httpserver by replacing the former line with the latter. This is +actually recommended if you rely on proxying from Apache or Nginx to a +``pserve`` -invoked application. **The wsgiref server is not a production +quality server.** See :ref:`alternate_wsgi_server` for more information. + +A new :mod:`pyramid.compat` module was added which provides Python 2/3 +straddling support for Pyramid add-ons and development environments. Python 3 compatibility required dropping some package dependencies and support for older Python versions and platforms. See the "Backwards @@ -30,8 +105,9 @@ A configuration introspection system was added; see :ref:`using_introspection` and :ref:`introspection` for more information on using the introspection system as a developer. -A new release of the pyramid debug toolbar will provide an "Introspection" -panel that presents introspection information to a developer. +The latest release of the pyramid debug toolbar (0.9.6) provides an +"Introspection" panel that exposes introspection information to a Pyramid +application developer. New APIs were added to support introspection :attr:`pyramid.registry.Introspectable`, @@ -68,7 +144,7 @@ Minor Feature Additions - Configuration conflict reporting is reported in a more understandable way ("Line 11 in file..." vs. a repr of a tuple of similar info). -- Allow extra keyword arguments to be passed to the +- We allow extra keyword arguments to be passed to the :meth:`pyramid.config.Configurator.action` method. Backwards Incompatibilities @@ -150,6 +226,6 @@ Scaffolding Changes - The ``routesalchemy`` scaffold has been renamed ``alchemy``, replacing the older (traversal-based) ``alchemy`` scaffold (which has been retired). -- The ``starter`` scaffold now uses URL dispatch by default. - +- The ``alchemy`` and ``starter`` scaffolds are Python 3 compatible. +- The ``starter`` scaffold now uses URL dispatch by default. -- cgit v1.2.3 From b39beb8e943f5be7bdf9c0e2d9fa82ceac59cfda Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 9 Dec 2011 13:03:03 -0500 Subject: typo --- docs/whatsnew-1.3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 7b485a725..1d7ea1362 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -23,8 +23,8 @@ Pyramid no longer runs on Python 2.5. This includes the most recent release of Jython and the Python 2.5 version of Google App Engine. We could not easily "straddle" Python 2 and 3 versions and support Python 2 versions older than Python 2.6. You will need Python 2.6 or better to run this version of -Pyramid. If you need to use Pyramid on Python 2.5, you should use the most -recent 1.2.X release fo Pyramid there. +Pyramid. If you need to use Python 2.5, you should use the most recent 1.2.X +release of Pyramid. Though many Pyramid add-ons have releases which are already Python 3 compatible (in particular ``pyramid_debugtoolbar``, ``pyramid_jinja2``, -- cgit v1.2.3 From c54498c078d538b996bb38e9ebf3ac683559aa13 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Fri, 9 Dec 2011 12:04:18 -0600 Subject: typo --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 1d7ea1362..678f08e2d 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -133,7 +133,7 @@ Minor Feature Additions - ``bpython`` interpreter compatibility in ``pshell``. See :ref:`ipython_or_bpython` for more information. -- Added :func:`pyramid.paster.get_appsettings`` API function. This function +- Added :func:`pyramid.paster.get_appsettings` API function. This function returns the settings defined within an ``[app:...]`` section in a PasteDeploy ``ini`` file. -- cgit v1.2.3 From 2f624f423bc1b087d92a4909b9859094d7e46cb8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 9 Dec 2011 14:18:47 -0500 Subject: bumped toolbar version --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 678f08e2d..3bb37dbf4 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -105,7 +105,7 @@ A configuration introspection system was added; see :ref:`using_introspection` and :ref:`introspection` for more information on using the introspection system as a developer. -The latest release of the pyramid debug toolbar (0.9.6) provides an +The latest release of the pyramid debug toolbar (0.9.7+) provides an "Introspection" panel that exposes introspection information to a Pyramid application developer. -- cgit v1.2.3 From 005e73ec6879359c9153e4de75f9c78591f96d9d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 9 Dec 2011 14:51:10 -0500 Subject: mention setup.py develop failure on py32 --- docs/whatsnew-1.3.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 3bb37dbf4..5ec64088f 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -17,6 +17,16 @@ Python 3 Compatibility Pyramid is now Python 3 compatible. Python 3.2 or better is required. +.. warning:: + + As of this writing (the release of Pyramid 1.3a1), if you attempt to + install a Pyramid scaffold via ``setup.py develop`` on Python 3.2, it may + quit with an installation error while trying to install ``Pygments``. If + this happens, please rerun the ``setup.py develop`` command again and it + will complete. We're just as clueless as you are as to why this happens + at this point, but hopefully we'll figure it out before Pyramid 1.3 leaves + the alpha/beta phase. + This feature required us to make some compromises. Pyramid no longer runs on Python 2.5. This includes the most recent release -- cgit v1.2.3 From d214e4d9fd2ad8220c15453b2d8ea04e5c9808f4 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 9 Dec 2011 14:59:56 -0500 Subject: be more specific --- docs/whatsnew-1.3.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 5ec64088f..bbf1d9842 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -20,12 +20,12 @@ Pyramid is now Python 3 compatible. Python 3.2 or better is required. .. warning:: As of this writing (the release of Pyramid 1.3a1), if you attempt to - install a Pyramid scaffold via ``setup.py develop`` on Python 3.2, it may - quit with an installation error while trying to install ``Pygments``. If - this happens, please rerun the ``setup.py develop`` command again and it - will complete. We're just as clueless as you are as to why this happens - at this point, but hopefully we'll figure it out before Pyramid 1.3 leaves - the alpha/beta phase. + install a Pyramid project that used ``alchemy`` scaffold via ``setup.py + develop`` on Python 3.2, it may quit with an installation error while + trying to install ``Pygments``. If this happens, please rerun the + ``setup.py develop`` command again and it will complete. We're just as + clueless as you are as to why this happens at this point, but hopefully + we'll figure it out before Pyramid 1.3 leaves the alpha/beta phase. This feature required us to make some compromises. -- cgit v1.2.3 From 19cde893354dfd4e2ffbcb1c3fd2a62fa43ab7fb Mon Sep 17 00:00:00 2001 From: Ronan Amicel Date: Fri, 9 Dec 2011 22:02:09 +0100 Subject: Fixed typos & minor edits. --- docs/whatsnew-1.3.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index bbf1d9842..d19935c97 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -57,14 +57,14 @@ to make some changes: Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application using ``paster create``, like so:: - $myvenv/bin/paster create -t pyramid_starter foo + $ myvenv/bin/paster create -t pyramid_starter foo You're now instead required to create an application using ``pcreate`` like so:: - $myvenv/bin/pcreate -s starter foo + $ myvenv/bin/pcreate -s starter foo -Note that the names of available scaffolds have changed the and flags +Note that the names of available scaffolds have changed and the flags supported by ``pcreate`` are different than those that were supported by ``paster create``. @@ -83,11 +83,11 @@ Analogues of ``paster pshell``, ``paster pviews`` and ``paster ptweens`` also exist under the respective console script names ``pshell``, ``pviews``, and ``ptweens``. -We've replaced use of the Paste http server with the ``wsgiref`` server in +We've replaced use of the Paste ``httpserver`` with the ``wsgiref`` server in the scaffolds, so once you create a project from a scaffold, its ``development.ini`` and ``production.ini`` will have the following line:: - use = egg:pyramid#wsgref + use = egg:pyramid#wsgiref Instead of this (which was the default in older versions):: @@ -96,7 +96,7 @@ Instead of this (which was the default in older versions):: Using ``wsgiref`` as the default WSGI server is purely a default to make it possible to use the same scaffolding under Python 2 and Python 3; people running Pyramid under Python 2 can still manually install ``Paste`` and use -the Paste httpserver by replacing the former line with the latter. This is +the Paste ``httpserver`` by replacing the former line with the latter. This is actually recommended if you rely on proxying from Apache or Nginx to a ``pserve`` -invoked application. **The wsgiref server is not a production quality server.** See :ref:`alternate_wsgi_server` for more information. -- cgit v1.2.3 From a4ef203907856cf72817a8a7296d27241fe0620a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 10 Dec 2011 22:40:22 -0500 Subject: remove double word --- docs/whatsnew-1.3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index d19935c97..f51c7977a 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -178,8 +178,8 @@ Backwards Incompatibilities ``paste.httpserver`` server. ``wsgiref``, unlike the server it replaced (``paste.httpserver``) is not a production quality server. See :ref:`alternate_wsgi_server` for information about how to use another WSGI - server in production. Rationale: Rationale: the Paste and PasteScript - packages do not run under Python 3. + server in production. Rationale: the Paste and PasteScript packages do not + run under Python 3. - The ``pshell`` command (see "paster pshell") no longer accepts a ``--disable-ipython`` command-line argument. Instead, it accepts a ``-p`` -- cgit v1.2.3 From 4375cf2bad3535ce896e95fcf1e388e33f2e8ecf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 14 Dec 2011 03:41:03 -0500 Subject: Flesh out new view_defaults feature and add docs, change notes, and add to whatsnew. --- docs/whatsnew-1.3.rst | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index f51c7977a..608db74cd 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -126,6 +126,70 @@ New APIs were added to support introspection :attr:`pyramid.config.Configurator.introspectable`, :attr:`pyramid.registry.Registry.introspector`. +``@view_defaults`` Decorator +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you use a class as a view, you can use the new +:class:`pyramid.view.view_defaults` class decorator on the class to provide +defaults to the view configuration information used by every ``@view_config`` +decorator that decorates a method of that class. + +For instance, if you've got a class that has methods that represent "REST +actions", all which are mapped to the same route, but different request +methods, instead of this: + +.. code-block:: python + :linenos: + + from pyramid.view import view_config + from pyramid.response import Response + + class RESTView(object): + def __init__(self, request): + self.request = request + + @view_config(route_name='rest', request_method='GET') + def get(self): + return Response('get') + + @view_config(route_name='rest', request_method='POST') + def post(self): + return Response('post') + + @view_config(route_name='rest', request_method='DELETE') + def delete(self): + return Response('delete') + +You can do this: + +.. code-block:: python + :linenos: + + from pyramid.view import view_defaults + from pyramid.view import view_config + from pyramid.response import Response + + @view_defaults(route_name='rest') + class RESTView(object): + def __init__(self, request): + self.request = request + + @view_config(request_method='GET') + def get(self): + return Response('get') + + @view_config(request_method='POST') + def post(self): + return Response('post') + + @view_config(request_method='DELETE') + def delete(self): + return Response('delete') + +This also works for imperative view configurations that involve a class. + +See :ref:`view_defaults` for more information. + Minor Feature Additions ----------------------- -- cgit v1.2.3 From bfd4b39b3467681ad34b1dda74acd20294e81a86 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 14 Dec 2011 09:10:10 -0500 Subject: - Changed scaffolding machinery around a bit to make it easier for people who want to have extension scaffolds that can work across Pyramid 1.0.X, 1.1.X, 1.2.X and 1.3.X. See the new "Creating Pyramid Scaffolds" chapter in the narrative documentation for more info. - Added an API docs chapter for ``pyramid.scaffolds``. - Added a narrative docs chapter named "Creating Pyramid Scaffolds". - The ``template_renderer`` method of ``pyramid.scaffolds.PyramidScaffold`` was renamed to ``render_template``. If you were overriding it, you're a bad person, because it wasn't an API before now. But we're nice so we're letting you know. --- docs/whatsnew-1.3.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 608db74cd..12132e7fd 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -276,6 +276,10 @@ Documentation Enhancements - A narrative documentation chapter named :ref:`using_introspection` was added. It describes how to query the introspection system. +- Added an API docs chapter for :mod:`pyramid.scaffolds`. + +- Added a narrative docs chapter named :ref:`scaffolding_chapter`. + Dependency Changes ------------------ -- cgit v1.2.3 From 6747aa8072b645a302a218d36283045c2a8381c6 Mon Sep 17 00:00:00 2001 From: michr Date: Wed, 14 Dec 2011 16:46:00 -0800 Subject: Added in a warning in whats new 1.3 about wsgiref beign more strict about returning string headers where as paste.httpserver converted them implicitly. --- docs/whatsnew-1.3.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 608db74cd..28c161ad0 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -101,6 +101,16 @@ actually recommended if you rely on proxying from Apache or Nginx to a ``pserve`` -invoked application. **The wsgiref server is not a production quality server.** See :ref:`alternate_wsgi_server` for more information. +.. warning:: + + Previously, paste.httpserver "helped" by converting header values that weren't + strings to strings. The wsgiref server, on the other hand implements the spec + more fully. This specifically may affect you if you are modifying headers on + your response. The following error might be an indicator of this problem: + **AssertionError: Header values must be strings, please check the type of + the header being returned.** A common case would be returning unicode headers + instead of string headers. + A new :mod:`pyramid.compat` module was added which provides Python 2/3 straddling support for Pyramid add-ons and development environments. -- cgit v1.2.3 From bc08bb6989f674e9c1c2ecf383bf5d71fc0d5f98 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 14 Dec 2011 22:23:14 -0500 Subject: mention backports and fix incorrect info about being able to use paster create for internal pyramid scaffolds --- docs/whatsnew-1.3.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 53ab8e91d..b0afacfe6 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -76,8 +76,10 @@ command:: The ``ini`` configuration file format supported by Pyramid has not changed. As a result, Python 2-only users can install PasteScript manually and use -``paster serve`` and ``paster create`` instead if they like. However, using -``pserve`` and ``pcreate`` will work under both Python 2 and Python 3. +``paster serve`` instead if they like. However, using ``pserve`` will work +under both Python 2 and Python 3. ``pcreate`` is required to be used for +internal Pyramid scaffolding; externally distributed scaffolding may allow +for both ``pcreate`` and/or ``paster create``. Analogues of ``paster pshell``, ``paster pviews`` and ``paster ptweens`` also exist under the respective console script names ``pshell``, ``pviews``, and @@ -101,6 +103,10 @@ actually recommended if you rely on proxying from Apache or Nginx to a ``pserve`` -invoked application. **The wsgiref server is not a production quality server.** See :ref:`alternate_wsgi_server` for more information. +New releases in every older major Pyramid series (1.0.2, 1.1.3, 1.2.5) also +have the ``egg:pyramid#wsgiref`` entry point, so scaffold-writers can depend +on it being there even in older major Pyramid versions. + .. warning:: Previously, paste.httpserver "helped" by converting header values that weren't -- cgit v1.2.3 From c8061ee1d797cb666e1d45e19765ede565d21915 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 15 Dec 2011 17:29:01 -0500 Subject: finish prequest feature --- docs/whatsnew-1.3.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index b0afacfe6..a69efd268 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -81,9 +81,9 @@ under both Python 2 and Python 3. ``pcreate`` is required to be used for internal Pyramid scaffolding; externally distributed scaffolding may allow for both ``pcreate`` and/or ``paster create``. -Analogues of ``paster pshell``, ``paster pviews`` and ``paster ptweens`` also -exist under the respective console script names ``pshell``, ``pviews``, and -``ptweens``. +Analogues of ``paster pshell``, ``paster pviews``, ``paster request`` and +``paster ptweens`` also exist under the respective console script names +``pshell``, ``pviews``, ``prequest`` and ``ptweens``. We've replaced use of the Paste ``httpserver`` with the ``wsgiref`` server in the scaffolds, so once you create a project from a scaffold, its @@ -296,6 +296,9 @@ Documentation Enhancements - Added a narrative docs chapter named :ref:`scaffolding_chapter`. +- Added a description of the ``prequest`` command-line script at + :ref:`invoking_a_request`. + Dependency Changes ------------------ -- cgit v1.2.3 From 61838b76639d6dcf9facd549841a2ed0d07ea012 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 15 Dec 2011 21:35:23 -0500 Subject: - Added a section named "Making Your Script into a Console Script" in the "Command-Line Pyramid" chapter. --- docs/whatsnew-1.3.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index a69efd268..8dd3c3cdb 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -299,6 +299,9 @@ Documentation Enhancements - Added a description of the ``prequest`` command-line script at :ref:`invoking_a_request`. +- Added a section to the "Command-Line Pyramid" chapter named + :ref:`making_a_console_script`. + Dependency Changes ------------------ -- cgit v1.2.3 From 9003a8bba654f98933b98dacac67760cff73e1c5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 16 Dec 2011 04:35:05 -0500 Subject: - Removed the "Running Pyramid on Google App Engine" tutorial from the main docs. It survives on in the Cookbook (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/gae.html). Rationale: it provides the correct info for the Python 2.5 version of GAE only, and this version of Pyramid does not support Python 2.5. --- docs/whatsnew-1.3.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 8dd3c3cdb..b61893536 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -302,6 +302,12 @@ Documentation Enhancements - Added a section to the "Command-Line Pyramid" chapter named :ref:`making_a_console_script`. +- Removed the "Running Pyramid on Google App Engine" tutorial from the main + docs. It survives on in the Cookbook + (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/gae.html). + Rationale: it provides the correct info for the Python 2.5 version of GAE + only, and this version of Pyramid does not support Python 2.5. + Dependency Changes ------------------ -- cgit v1.2.3 From b73edc8a1b99dd513cfe82c045f3e6bb502f4c69 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Fri, 30 Dec 2011 02:32:54 -0600 Subject: Updated the changelog for Request.set_property. --- docs/whatsnew-1.3.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index b61893536..acbaa1335 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -206,6 +206,16 @@ This also works for imperative view configurations that involve a class. See :ref:`view_defaults` for more information. +Extending a Request without Subclassing +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It is now possible to extend a :class:`pyramid.request.Request` object +with property descriptors without having to create a subclass via +:meth:`pyramid.request.Request.set_property`. New properties may be +reified, effectively caching the value for the lifetime of the instance. +Common use-cases for this would be to get a database connection for the +request or identify the current user. + Minor Feature Additions ----------------------- -- cgit v1.2.3 From 030d10697cc52a5c26d19818140616a485f63428 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 2 Jan 2012 20:41:44 -0500 Subject: - Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding. --- docs/whatsnew-1.3.rst | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index acbaa1335..e8d549e60 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -52,7 +52,7 @@ to make some changes: - We've replaced the ``paster`` command with Pyramid-specific analogues. -- We've made the default WSGI server the ``wsgiref`` server. +- We've made the default WSGI server the ``waitress`` server. Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application using ``paster create``, like so:: @@ -85,37 +85,25 @@ Analogues of ``paster pshell``, ``paster pviews``, ``paster request`` and ``paster ptweens`` also exist under the respective console script names ``pshell``, ``pviews``, ``prequest`` and ``ptweens``. -We've replaced use of the Paste ``httpserver`` with the ``wsgiref`` server in +We've replaced use of the Paste ``httpserver`` with the ``waitress`` server in the scaffolds, so once you create a project from a scaffold, its ``development.ini`` and ``production.ini`` will have the following line:: - use = egg:pyramid#wsgiref + use = egg:waitress#main Instead of this (which was the default in older versions):: use = egg:Paste#http -Using ``wsgiref`` as the default WSGI server is purely a default to make it -possible to use the same scaffolding under Python 2 and Python 3; people -running Pyramid under Python 2 can still manually install ``Paste`` and use -the Paste ``httpserver`` by replacing the former line with the latter. This is -actually recommended if you rely on proxying from Apache or Nginx to a -``pserve`` -invoked application. **The wsgiref server is not a production -quality server.** See :ref:`alternate_wsgi_server` for more information. - -New releases in every older major Pyramid series (1.0.2, 1.1.3, 1.2.5) also -have the ``egg:pyramid#wsgiref`` entry point, so scaffold-writers can depend -on it being there even in older major Pyramid versions. - .. warning:: - Previously, paste.httpserver "helped" by converting header values that weren't - strings to strings. The wsgiref server, on the other hand implements the spec - more fully. This specifically may affect you if you are modifying headers on - your response. The following error might be an indicator of this problem: - **AssertionError: Header values must be strings, please check the type of - the header being returned.** A common case would be returning unicode headers - instead of string headers. + Previously, paste.httpserver "helped" by converting header values that + weren't strings to strings. The ``waitress`` server, on the other hand + implements the spec more fully. This specifically may affect you if you + are modifying headers on your response. The following error might be an + indicator of this problem: **AssertionError: Header values must be + strings, please check the type of the header being returned.** A common + case would be returning unicode headers instead of string headers. A new :mod:`pyramid.compat` module was added which provides Python 2/3 straddling support for Pyramid add-ons and development environments. @@ -264,12 +252,9 @@ Backwards Incompatibilities Python 3. - The default WSGI server run as the result of ``pserve`` from newly rendered - scaffolding is now the ``wsgiref`` WSGI server instead of the - ``paste.httpserver`` server. ``wsgiref``, unlike the server it replaced - (``paste.httpserver``) is not a production quality server. See - :ref:`alternate_wsgi_server` for information about how to use another WSGI - server in production. Rationale: the Paste and PasteScript packages do not - run under Python 3. + scaffolding is now the ``waitress`` WSGI server instead of the + ``paste.httpserver`` server. Rationale: the Paste and PasteScript packages + do not run under Python 3. - The ``pshell`` command (see "paster pshell") no longer accepts a ``--disable-ipython`` command-line argument. Instead, it accepts a ``-p`` -- cgit v1.2.3 From 962816fb573547e59a4c376c25e11b0597eee9d6 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 5 Jan 2012 08:44:20 -0500 Subject: whatsnew --- docs/whatsnew-1.3.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index e8d549e60..eb8617ff1 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -271,6 +271,30 @@ Backwards Incompatibilities and upgrade Pyramid itself "in-place"; it may simply break instead (particularly if you use ZCML's ``includeOverrides`` directive). +- String values passed to ``route_url`` or ``route_path`` that are meant to + replace "remainder" matches will now be URL-quoted except for embedded + slashes. For example:: + + config.add_route('remain', '/foo*remainder') + request.route_path('remain', remainder='abc / def') + # -> '/foo/abc%20/%20def' + + Previously string values passed as remainder replacements were tacked on + untouched, without any URL-quoting. But this doesn't really work logically + if the value passed is Unicode (raw unicode cannot be placed in a URL or in + a path) and it is inconsistent with the rest of the URL generation + machinery if the value is a string (it won't be quoted unless by the + caller). + + Some folks will have been relying on the older behavior to tack on query + string elements and anchor portions of the URL; sorry, you'll need to + change your code to use the ``_query`` and/or ``_anchor`` arguments to + ``route_path`` or ``route_url`` to do this now. + +- If you pass a bytestring that contains non-ASCII characters to + ``add_route`` as a pattern, it will now fail at startup time. Use Unicode + instead. + Documentation Enhancements -------------------------- -- cgit v1.2.3 From 6c2e8fb0f75939ebff014a7bf16500003ab9f1af Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 11 Jan 2012 02:30:57 -0600 Subject: Updated the changelogs. --- docs/whatsnew-1.3.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index eb8617ff1..ee4e2ccb5 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -198,11 +198,16 @@ Extending a Request without Subclassing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is now possible to extend a :class:`pyramid.request.Request` object -with property descriptors without having to create a subclass via -:meth:`pyramid.request.Request.set_property`. New properties may be -reified, effectively caching the value for the lifetime of the instance. -Common use-cases for this would be to get a database connection for the -request or identify the current user. +with property descriptors without having to create a custom request factory. +The new method :meth:`pyramid.config.Configurator.set_request_property` +provides an entry point for addons to register properties which will be +added to each request. New properties may be reified, effectively caching +the return value for the lifetime of the instance. Common use-cases for this +would be to get a database connection for the request or identify the current +user. The new method :meth:`pyramid.request.Request.set_property` has been +added, as well, but the configurator method should be preferred as it +provides conflict detection and consistency in the lifetime of the +properties. Minor Feature Additions ----------------------- -- cgit v1.2.3 From a41c8ca521ba983594364b1eb1f6c6025149fbe7 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 20 Jan 2012 10:53:55 -0500 Subject: prep for 1.3a6 --- docs/whatsnew-1.3.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index ee4e2ccb5..ed7024f62 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -240,6 +240,16 @@ Minor Feature Additions - We allow extra keyword arguments to be passed to the :meth:`pyramid.config.Configurator.action` method. +- New API: :meth:`pyramid.config.Configurator.set_request_property`. Add lazy + property descriptors to a request without changing the request factory. + This method provides conflict detection and is the suggested way to add + properties to a request. + +- Responses generated by Pyramid's :class:`pyramid.views.static_view` now use + a ``wsgi.file_wrapper`` (see + http://www.python.org/dev/peps/pep-0333/#optional-platform-specific-file-handling) + when one is provided by the web server. + Backwards Incompatibilities --------------------------- @@ -300,6 +310,11 @@ Backwards Incompatibilities ``add_route`` as a pattern, it will now fail at startup time. Use Unicode instead. +- The ``path_info`` route and view predicates now match against + ``request.upath_info`` (Unicode) rather than ``request.path_info`` + (indeterminate value based on Python 3 vs. Python 2). This has to be done + to normalize matching on Python 2 and Python 3. + Documentation Enhancements -------------------------- -- cgit v1.2.3 From d8afa3b5cb5e896700e654c3b8d90de54d54269c Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 29 Jan 2012 01:06:46 -0800 Subject: Clarify Python 2 and 3 compatibility for tl;dr users. --- docs/whatsnew-1.3.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index ee4e2ccb5..cdb7a3b4f 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -15,7 +15,9 @@ The major feature additions in Pyramid 1.3 follow. Python 3 Compatibility ~~~~~~~~~~~~~~~~~~~~~~ -Pyramid is now Python 3 compatible. Python 3.2 or better is required. +In addition to running on Python 2 (version 2.6 or 2.7 required), Pyramid is +now Python 3 compatible. For Python 3 compatibility, Python 3.2 or better +is required. .. warning:: -- cgit v1.2.3 From e3f9d0e6ea3c98699de7b60bc3900b1a40fcba19 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 8 Feb 2012 00:05:31 -0500 Subject: prep for 1.3a7 --- docs/whatsnew-1.3.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 2793471a3..231421262 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -317,6 +317,10 @@ Backwards Incompatibilities (indeterminate value based on Python 3 vs. Python 2). This has to be done to normalize matching on Python 2 and Python 3. +- The ``match_param`` view predicate no longer accepts a dict. This will have + no negative affect because the implementation was broken for dict-based + arguments. + Documentation Enhancements -------------------------- -- cgit v1.2.3 From e4b8fa632c5d2b020e168f4efe3d7c00049a279f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 9 Feb 2012 00:12:26 -0500 Subject: Features -------- - The ``scan`` method of a ``Configurator`` can be passed an ``ignore`` argument, which can be a string, a callable, or a list consisting of strings and/or callables. This feature allows submodules, subpackages, and global objects from being scanned. See http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for more information about how to use the ``ignore`` argument to ``scan``. Dependencies ------------ - Depend on ``venusian`` >= 1.0a3 to provide scan ``ignore`` support. --- docs/whatsnew-1.3.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 231421262..b6cfde039 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -252,6 +252,13 @@ Minor Feature Additions http://www.python.org/dev/peps/pep-0333/#optional-platform-specific-file-handling) when one is provided by the web server. +- The :meth:`pyramid.config.Configurator.scan` method can be passed an + ``ignore`` argument, which can be a string, a callable, or a list + consisting of strings and/or callables. This feature allows submodules, + subpackages, and global objects from being scanned. See + http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for + more information about how to use the ``ignore`` argument to ``scan``. + Backwards Incompatibilities --------------------------- -- cgit v1.2.3 From f9bcf47164a151587244deb3ce5334ba447e3b99 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 15 Feb 2012 19:13:58 -0500 Subject: update whatsnew --- docs/whatsnew-1.3.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index b6cfde039..918870018 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -259,6 +259,30 @@ Minor Feature Additions http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for more information about how to use the ``ignore`` argument to ``scan``. +- Add :meth:`pyramid.config.Configurator.set_traverser` API method. See + :ref:`changing_the_traverser` for more information. This is not a new + feature, it just provides an API for adding a traverser without needing to + use the ZCA API. + +- The :meth:`pyramid.config.Configurator.scan` method can now be passed an + ``ignore`` argument, which can be a string, a callable, or a list + consisting of strings and/or callables. This feature allows submodules, + subpackages, and global objects from being scanned. See + http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for + more information about how to use the ``ignore`` argument to ``scan``. + +- Better error messages when a view callable returns a value that cannot be + converted to a response (for example, when a view callable returns a + dictionary without a renderer defined, or doesn't return any value at all). + The error message now contains information about the view callable itself + as well as the result of calling it. + +- Better error message when a .pyc-only module is ``config.include`` -ed. + This is not permitted due to error reporting requirements, and a better + error message is shown when it is attempted. Previously it would fail with + something like "AttributeError: 'NoneType' object has no attribute + 'rfind'". + Backwards Incompatibilities --------------------------- @@ -375,6 +399,8 @@ Dependency Changes - Pyramid no longer depends on the ``Paste`` or ``PasteScript`` packages. These packages are not Python 3 compatible. +- Depend on ``venusian`` >= 1.0a3 to provide scan ``ignore`` support. + Scaffolding Changes ------------------- -- cgit v1.2.3 From 4786cae2e7a053b01091b5e185102f9c26885b08 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 15 Feb 2012 19:32:46 -0500 Subject: - The system value ``r`` is now supplied to renderers as an alias for ``request``. This means that you can now, for example, in a template, do ``r.route_url(...)`` instead of ``request.route_url(...)``. Fixes #413. --- docs/whatsnew-1.3.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 918870018..c4bde2b54 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -54,7 +54,8 @@ to make some changes: - We've replaced the ``paster`` command with Pyramid-specific analogues. -- We've made the default WSGI server the ``waitress`` server. +- We've made the default WSGI server used by Pyramid scaffolding the + :term:`waitress` server. Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application using ``paster create``, like so:: @@ -283,6 +284,10 @@ Minor Feature Additions something like "AttributeError: 'NoneType' object has no attribute 'rfind'". +- The system value ``r`` is now supplied to renderers as an alias for + ``request``. This means that you can now, for example, in a template, do + ``r.route_url(...)`` instead of ``request.route_url(...)``. + Backwards Incompatibilities --------------------------- -- cgit v1.2.3 From b2ea4c88b8b3bc9ed657160d8a888780d6c41844 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 15 Feb 2012 22:06:30 -0500 Subject: Use req instead of r for #413. It's more likely that somebody is already passing something named r, and a template may depend on its existence or nonexistence to conditionalize rendering a bit of html. --- docs/whatsnew-1.3.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index c4bde2b54..a27ef6af9 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -284,9 +284,12 @@ Minor Feature Additions something like "AttributeError: 'NoneType' object has no attribute 'rfind'". -- The system value ``r`` is now supplied to renderers as an alias for +- The system value ``req`` is now supplied to renderers as an alias for ``request``. This means that you can now, for example, in a template, do - ``r.route_url(...)`` instead of ``request.route_url(...)``. + ``req.route_url(...)`` instead of ``request.route_url(...)``. This is + purely a change to reduce the amount of typing required to use request + methods and attributes from within templates. The value ``request`` is + still available too, this is just an alternative. Backwards Incompatibilities --------------------------- -- cgit v1.2.3 From c51896756eeffc7e8c50ad71300ec355ae47465a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 17 Feb 2012 01:08:42 -0500 Subject: Features -------- - Add ``pyramid.config.Configurator.add_resource_url_adapter`` API method. See the Hooks narrative documentation section entitled "Changing How pyramid.request.Request.resource_url Generates a URL" for more information. This is not a new feature, it just provides an API for adding a resource url adapter without needing to use the ZCA API. - A new interface was added: ``pyramid.interfaces.IResourceURL``. An adapter implementing its interface can be used to override resource URL generation when ``request.resource_url`` is called. This interface replaces the now-deprecated ``pyramid.interfaces.IContextURL`` interface. - The dictionary passed to a resource's ``__resource_url__`` method (see "Overriding Resource URL Generation" in the "Resources" chapter) now contains an ``app_url`` key, representing the application URL generated during ``request.resource_url``. It represents a potentially customized URL prefix, containing potentially custom scheme, host and port information passed by the user to ``request.resource_url``. It should be used instead of ``request.application_url`` where necessary. - The ``request.resource_url`` API now accepts these arguments: ``app_url``, ``scheme``, ``host``, and ``port``. The app_url argument can be used to replace the URL prefix wholesale during url generation. The ``scheme``, ``host``, and ``port`` arguments can be used to replace the respective default values of ``request.application_url`` partially. - A new API named ``request.resource_path`` now exists. It works like ``request.resource_url`` but produces a relative URL rather than an absolute one. - The ``request.route_url`` API now accepts these arguments: ``_app_url``, ``_scheme``, ``_host``, and ``_port``. The ``_app_url`` argument can be used to replace the URL prefix wholesale during url generation. The ``_scheme``, ``_host``, and ``_port`` arguments can be used to replace the respective default values of ``request.application_url`` partially. Backwards Incompatibilities --------------------------- - The ``pyramid.interfaces.IContextURL`` interface has been deprecated. People have been instructed to use this to register a resource url adapter in the "Hooks" chapter to use to influence ``request.resource_url`` URL generation for resources found via custom traversers since Pyramid 1.0. The interface still exists and registering such an adapter still works, but this interface will be removed from the software after a few major Pyramid releases. You should replace it with an equivalent ``pyramid.interfaces.IResourceURL`` adapter, registered using the new ``pyramid.config.Configurator.add_resource_url_adapter`` API. A deprecation warning is now emitted when a ``pyramid.interfaces.IContextURL`` adapter is found when ``request.resource_url`` is called. Misc ---- - Change ``set_traverser`` API name to ``add_traverser``. Ref #438. --- docs/whatsnew-1.3.rst | 56 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index a27ef6af9..7d1c9217d 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -260,16 +260,21 @@ Minor Feature Additions http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for more information about how to use the ``ignore`` argument to ``scan``. -- Add :meth:`pyramid.config.Configurator.set_traverser` API method. See +- Add :meth:`pyramid.config.Configurator.add_traverser` API method. See :ref:`changing_the_traverser` for more information. This is not a new feature, it just provides an API for adding a traverser without needing to use the ZCA API. +- Add :meth:`pyramid.config.Configurator.add_resource_url_adapter` API + method. See :ref:`changing_resource_url` for more information. This is + not a new feature, it just provides an API for adding a resource url + adapter without needing to use the ZCA API. + - The :meth:`pyramid.config.Configurator.scan` method can now be passed an ``ignore`` argument, which can be a string, a callable, or a list consisting of strings and/or callables. This feature allows submodules, subpackages, and global objects from being scanned. See - http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for + http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for more information about how to use the ``ignore`` argument to ``scan``. - Better error messages when a view callable returns a value that cannot be @@ -291,6 +296,38 @@ Minor Feature Additions methods and attributes from within templates. The value ``request`` is still available too, this is just an alternative. +- A new interface was added: :class:`pyramid.interfaces.IResourceURL`. An + adapter implementing its interface can be used to override resource URL + generation when :meth:`pyramid.request.Request.resource_url` is called. + This interface replaces the now-deprecated + ``pyramid.interfaces.IContextURL`` interface. + +- The dictionary passed to a resource's ``__resource_url__`` method (see + :ref:`overriding_resource_url_generation`) now contains an ``app_url`` key, + representing the application URL generated during + :meth:`pyramid.request.Request.resource_url`. It represents a potentially + customized URL prefix, containing potentially custom scheme, host and port + information passed by the user to ``request.resource_url``. It should be + used instead of ``request.application_url`` where necessary. + +- The :meth:`pyramid.request.Request.resource_url` API now accepts these + arguments: ``app_url``, ``scheme``, ``host``, and ``port``. The app_url + argument can be used to replace the URL prefix wholesale during url + generation. The ``scheme``, ``host``, and ``port`` arguments can be used + to replace the respective default values of ``request.application_url`` + partially. + +- A new API named :meth:`pyramid.request.Request.resource_path` now exists. + It works like :meth:`pyramid.request.Request.resource_url`` but produces a + relative URL rather than an absolute one. + +- The :meth:`pyramid.request.Request.route_url` API now accepts these + arguments: ``_app_url``, ``_scheme``, ``_host``, and ``_port``. The + ``_app_url`` argument can be used to replace the URL prefix wholesale + during url generation. The ``_scheme``, ``_host``, and ``_port`` arguments + can be used to replace the respective default values of + ``request.application_url`` partially. + Backwards Incompatibilities --------------------------- @@ -360,6 +397,21 @@ Backwards Incompatibilities no negative affect because the implementation was broken for dict-based arguments. +- The ``pyramid.interfaces.IContextURL`` interface has been deprecated. + People have been instructed to use this to register a resource url adapter + in the "Hooks" chapter to use to influence + :meth:`pyramid.request.Request.resource_url` URL generation for resources + found via custom traversers since Pyramid 1.0. + + The interface still exists and registering such an adapter still works, but + this interface will be removed from the software after a few major Pyramid + releases. You should replace it with an equivalent + :class:`pyramid.interfaces.IResourceURL` adapter, registered using the new + :meth:`pyramid.config.Configurator.add_resource_url_adapter` API. A + deprecation warning is now emitted when a + ``pyramid.interfaces.IContextURL`` adapter is found when + :meth:`pyramid.request.Request.resource_url` is called. + Documentation Enhancements -------------------------- -- cgit v1.2.3 From 0a6a26ca36f6aff7d03b438eef57f6b8d17123e9 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 17 Feb 2012 08:55:45 -0500 Subject: docs fixes --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 7d1c9217d..674b16e11 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -274,7 +274,7 @@ Minor Feature Additions ``ignore`` argument, which can be a string, a callable, or a list consisting of strings and/or callables. This feature allows submodules, subpackages, and global objects from being scanned. See - http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for + http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for more information about how to use the ``ignore`` argument to ``scan``. - Better error messages when a view callable returns a value that cannot be -- cgit v1.2.3 From 305d23f9e9dd095f4fdface116a2155bd86a453c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 17 Feb 2012 18:29:10 -0500 Subject: docs fixes --- docs/whatsnew-1.3.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 674b16e11..acb884d49 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -364,9 +364,10 @@ Backwards Incompatibilities and upgrade Pyramid itself "in-place"; it may simply break instead (particularly if you use ZCML's ``includeOverrides`` directive). -- String values passed to ``route_url`` or ``route_path`` that are meant to - replace "remainder" matches will now be URL-quoted except for embedded - slashes. For example:: +- String values passed to :meth:`Pyramid.request.Request.route_url` or + :meth:`Pyramid.request.Request.route_path` that are meant to replace + "remainder" matches will now be URL-quoted except for embedded slashes. For + example:: config.add_route('remain', '/foo*remainder') request.route_path('remain', remainder='abc / def') @@ -385,8 +386,8 @@ Backwards Incompatibilities ``route_path`` or ``route_url`` to do this now. - If you pass a bytestring that contains non-ASCII characters to - ``add_route`` as a pattern, it will now fail at startup time. Use Unicode - instead. + :meth:`pyramid.config.Configurator.add_route` as a pattern, it will now + fail at startup time. Use Unicode instead. - The ``path_info`` route and view predicates now match against ``request.upath_info`` (Unicode) rather than ``request.path_info`` @@ -403,10 +404,11 @@ Backwards Incompatibilities :meth:`pyramid.request.Request.resource_url` URL generation for resources found via custom traversers since Pyramid 1.0. - The interface still exists and registering such an adapter still works, but - this interface will be removed from the software after a few major Pyramid - releases. You should replace it with an equivalent - :class:`pyramid.interfaces.IResourceURL` adapter, registered using the new + The interface still exists and registering an adapter using it as + documented in older versions still works, but this interface will be + removed from the software after a few major Pyramid releases. You should + replace it with an equivalent :class:`pyramid.interfaces.IResourceURL` + adapter, registered using the new :meth:`pyramid.config.Configurator.add_resource_url_adapter` API. A deprecation warning is now emitted when a ``pyramid.interfaces.IContextURL`` adapter is found when -- cgit v1.2.3 From 3885448eea74d4c79bf34dae0fb3a7fc767cb85c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 17 Feb 2012 20:58:12 -0500 Subject: docs rearranging / fixing --- docs/whatsnew-1.3.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index acb884d49..d2df88093 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -243,11 +243,6 @@ Minor Feature Additions - We allow extra keyword arguments to be passed to the :meth:`pyramid.config.Configurator.action` method. -- New API: :meth:`pyramid.config.Configurator.set_request_property`. Add lazy - property descriptors to a request without changing the request factory. - This method provides conflict detection and is the suggested way to add - properties to a request. - - Responses generated by Pyramid's :class:`pyramid.views.static_view` now use a ``wsgi.file_wrapper`` (see http://www.python.org/dev/peps/pep-0333/#optional-platform-specific-file-handling) @@ -318,7 +313,7 @@ Minor Feature Additions partially. - A new API named :meth:`pyramid.request.Request.resource_path` now exists. - It works like :meth:`pyramid.request.Request.resource_url`` but produces a + It works like :meth:`pyramid.request.Request.resource_url` but produces a relative URL rather than an absolute one. - The :meth:`pyramid.request.Request.route_url` API now accepts these -- cgit v1.2.3 From 0d0b5bf8c8369cda8f26f6d12068c500ca900d7c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 20 Feb 2012 13:27:15 -0500 Subject: modify whatsnew --- docs/whatsnew-1.3.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index d2df88093..0a8205d61 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -128,7 +128,6 @@ application developer. New APIs were added to support introspection :attr:`pyramid.registry.Introspectable`, -:attr:`pyramid.registry.noop_introspector`, :attr:`pyramid.config.Configurator.introspector`, :attr:`pyramid.config.Configurator.introspectable`, :attr:`pyramid.registry.Registry.introspector`. -- cgit v1.2.3 From 2d045891789c58856831dc676d06c0b86fdd84c5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 22 Feb 2012 18:04:23 -0500 Subject: maintain whatsnew --- docs/whatsnew-1.3.rst | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 0a8205d61..7f6c3d7cb 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -211,6 +211,22 @@ added, as well, but the configurator method should be preferred as it provides conflict detection and consistency in the lifetime of the properties. +Not Found View Helpers +~~~~~~~~~~~~~~~~~~~~~~ + +- New API: :meth:`pyramid.config.Configurator.add_notfound_view`. This is a + wrapper for :meth:`pyramid.Config.configurator.add_view` which provides + support for an "append_slash" feature as well as doing the right thing when + it comes to permissions (a not found view should always be public). It + should be preferred over calling ``add_view`` directly with + ``context=HTTPNotFound`` as was previously recommended. + +- New API: :class:`pyramid.view.notfound_view_config``. This is a decorator + constructor like :class:`pyramid.view.view_config` that calls + :meth:`pyramid.config.Configurator.add_notfound_view` when scanned. It + should be preferred over using ``pyramid.view.view_config`` with + ``context=HTTPNotFound`` as was previously recommended. + Minor Feature Additions ----------------------- @@ -408,6 +424,35 @@ Backwards Incompatibilities ``pyramid.interfaces.IContextURL`` adapter is found when :meth:`pyramid.request.Request.resource_url` is called. +- Remove ``pyramid.config.Configurator.with_context`` class method. It was + never an API, it is only used by ``pyramid_zcml`` and its functionality has + been moved to that package's latest release. This means that you'll need + to use the 0.9.2 or later release of ``pyramid_zcml`` with this release of + Pyramid. + +- The older deprecated ``set_notfound_view`` Configurator method is now an + alias for the new :meth:`pyramid.config.Configurator.add_notfound_view` + method. This has the following impact: the ``context`` sent to views with + a ``(context, request)`` call signature registered via the deprecated + ``add_notfound_view`` / ``set_notfound_view`` will now be the HTTPNotFound + exception object instead of the actual resource context found. Use + ``request.context`` to get the actual resource context. It's also + recommended to disuse ``set_notfound_view`` in favor of + ``add_notfound_view``, despite the aliasing. + +Deprecations +------------ + +- The API documentation for ``pyramid.view.append_slash_notfound_view`` and + ``pyramid.view.AppendSlashNotFoundViewFactory`` was removed. These names + still exist and are still importable, but they are no longer APIs. Use + ``pyramid.config.Configurator.add_notfound_view(append_slash=True)`` or + ``pyramid.view.notfound_view_config(append_slash=True)`` to get the same + behavior. + +- The ``set_forbidden_view`` method of the Configurator was removed from the + documentation. It has been deprecated since Pyramid 1.1. + Documentation Enhancements -------------------------- @@ -440,6 +485,14 @@ Documentation Enhancements Rationale: it provides the correct info for the Python 2.5 version of GAE only, and this version of Pyramid does not support Python 2.5. +- Updated the :ref:`changing_the_notfound_view` section, replacing + explanations of registering a view using ``add_view`` or ``view_config`` + with ones using ``add_notfound_view`` or ``notfound_view_config``. + +- Updated the :ref:`redirecting_to_slash_appended_routes` section, replacing + explanations of registering a view using ``add_view`` or ``view_config`` + with ones using ``add_notfound_view`` or ``notfound_view_config`` + Dependency Changes ------------------ -- cgit v1.2.3 From a7fe30f0eabd6c6fd3bcc910faa41720a75056de Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 22 Feb 2012 19:24:09 -0500 Subject: - New API: ``pyramid.config.Configurator.add_forbidden_view``. This is a wrapper for ``pyramid.Config.configurator.add_view`` which does the right thing about permissions. It should be preferred over calling ``add_view`` directly with ``context=HTTPForbidden`` as was previously recommended. - New API: ``pyramid.view.forbidden_view_config``. This is a decorator constructor like ``pyramid.view.view_config`` that calls ``pyramid.config.Configurator.add_forbidden_view`` when scanned. It should be preferred over using ``pyramid.view.view_config`` with ``context=HTTPForbidden`` as was previously recommended. - Updated the "Creating a Not Forbidden View" section of the "Hooks" chapter, replacing explanations of registering a view using ``add_view`` or ``view_config`` with ones using ``add_forbidden_view`` or ``forbidden_view_config``. - Updated all tutorials to use ``pyramid.view.forbidden_view_config`` rather than ``pyramid.view.view_config`` with an HTTPForbidden context. --- docs/whatsnew-1.3.rst | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 7f6c3d7cb..101caed94 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -211,8 +211,10 @@ added, as well, but the configurator method should be preferred as it provides conflict detection and consistency in the lifetime of the properties. -Not Found View Helpers -~~~~~~~~~~~~~~~~~~~~~~ +Not Found and Forbidden View Helpers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Not Found helpers: - New API: :meth:`pyramid.config.Configurator.add_notfound_view`. This is a wrapper for :meth:`pyramid.Config.configurator.add_view` which provides @@ -227,6 +229,20 @@ Not Found View Helpers should be preferred over using ``pyramid.view.view_config`` with ``context=HTTPNotFound`` as was previously recommended. +Forbidden helpers: + +- New API: :meth:`pyramid.config.Configurator.add_forbidden_view`. This is a + wrapper for :meth:`pyramid.Config.configurator.add_view` which does the + right thing about permissions. It should be preferred over calling + ``add_view`` directly with ``context=HTTPForbidden`` as was previously + recommended. + +- New API: :class:`pyramid.view.forbidden_view_config`. This is a decorator + constructor like :class:`pyramid.view.view_config` that calls + :meth:`pyramid.config.Configurator.add_forbidden_view` when scanned. It + should be preferred over using ``pyramid.view.view_config`` with + ``context=HTTPForbidden`` as was previously recommended. + Minor Feature Additions ----------------------- @@ -431,14 +447,16 @@ Backwards Incompatibilities Pyramid. - The older deprecated ``set_notfound_view`` Configurator method is now an - alias for the new :meth:`pyramid.config.Configurator.add_notfound_view` - method. This has the following impact: the ``context`` sent to views with - a ``(context, request)`` call signature registered via the deprecated - ``add_notfound_view`` / ``set_notfound_view`` will now be the HTTPNotFound - exception object instead of the actual resource context found. Use + alias for the new ``add_notfound_view`` Configurator method. Likewise, the + older deprecated ``set_forbidden_view`` is now an alias for the new + ``add_forbidden_view`` Configurator method. This has the following impact: + the ``context`` sent to views with a ``(context, request)`` call signature + registered via the ``set_notfound_view`` or ``set_forbidden_view`` will now + be an exception object instead of the actual resource context found. Use ``request.context`` to get the actual resource context. It's also recommended to disuse ``set_notfound_view`` in favor of - ``add_notfound_view``, despite the aliasing. + ``add_notfound_view``, and disuse ``set_forbidden_view`` in favor of + ``add_forbidden_view`` despite the aliasing. Deprecations ------------ @@ -450,8 +468,9 @@ Deprecations ``pyramid.view.notfound_view_config(append_slash=True)`` to get the same behavior. -- The ``set_forbidden_view`` method of the Configurator was removed from the - documentation. It has been deprecated since Pyramid 1.1. +- The ``set_forbidden_view`` and ``set_notfound_view`` methods of the + Configurator were removed from the documentation. They have been + deprecated since Pyramid 1.1. Documentation Enhancements -------------------------- @@ -485,6 +504,10 @@ Documentation Enhancements Rationale: it provides the correct info for the Python 2.5 version of GAE only, and this version of Pyramid does not support Python 2.5. +- Updated the :ref:`changing_the_forbidden_view` section, replacing + explanations of registering a view using ``add_view`` or ``view_config`` + with ones using ``add_forbidden_view`` or ``forbidden_view_config``. + - Updated the :ref:`changing_the_notfound_view` section, replacing explanations of registering a view using ``add_view`` or ``view_config`` with ones using ``add_notfound_view`` or ``notfound_view_config``. @@ -493,6 +516,9 @@ Documentation Enhancements explanations of registering a view using ``add_view`` or ``view_config`` with ones using ``add_notfound_view`` or ``notfound_view_config`` +- Updated all tutorials to use ``pyramid.view.forbidden_view_config`` rather + than ``pyramid.view.view_config`` with an HTTPForbidden context. + Dependency Changes ------------------ -- cgit v1.2.3 From 6b3cca0d548c0c3bcec62902f5b261df4e7c1d1e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 22 Feb 2012 20:02:03 -0500 Subject: - New APIs: ``pyramid.response.FileResponse`` and ``pyramid.response.FileIter``, for usage in views that must serve files "manually". --- docs/whatsnew-1.3.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 101caed94..daa1ffdec 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -354,6 +354,10 @@ Minor Feature Additions can be used to replace the respective default values of ``request.application_url`` partially. +- New APIs: :class:`pyramid.response.FileResponse` and + :class:`pyramid.response.FileIter`, for usage in views that must serve + files "manually". + Backwards Incompatibilities --------------------------- -- cgit v1.2.3 From 01eac92dcdbe0d51b75783350997e69a7613da9e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 24 Feb 2012 15:15:18 -0500 Subject: docs-deprecate tmpl_context --- docs/whatsnew-1.3.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index daa1ffdec..ac01bb140 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -476,6 +476,14 @@ Deprecations Configurator were removed from the documentation. They have been deprecated since Pyramid 1.1. +- All references to the ``tmpl_context`` request variable were removed from + the docs. Its existence in Pyramid is confusing for people who were never + Pylons users. It was added as a porting convenience for Pylons users in + Pyramid 1.0, but it never caught on because the Pyramid rendering system is + a lot different than Pylons' was, and alternate ways exist to do what it + was designed to offer in Pylons. It will continue to exist "forever" but + it will not be recommended or mentioned in the docs. + Documentation Enhancements -------------------------- -- cgit v1.2.3 From 14ff468d2ec1a9a6f4ddbe78ddabadbd08b268db Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 2 Mar 2012 01:58:34 -0500 Subject: point at sqla bug --- docs/whatsnew-1.3.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index ac01bb140..cc960f8c1 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -21,13 +21,14 @@ is required. .. warning:: - As of this writing (the release of Pyramid 1.3a1), if you attempt to - install a Pyramid project that used ``alchemy`` scaffold via ``setup.py - develop`` on Python 3.2, it may quit with an installation error while - trying to install ``Pygments``. If this happens, please rerun the - ``setup.py develop`` command again and it will complete. We're just as - clueless as you are as to why this happens at this point, but hopefully - we'll figure it out before Pyramid 1.3 leaves the alpha/beta phase. + As of this writing (the release of Pyramid 1.3b2), if you attempt to + install a Pyramid project that used the ``alchemy`` scaffold via + ``setup.py develop`` on Python 3.2, it will quit with an installation + error while trying to install ``Pygments``. If this happens, please just + rerun the ``setup.py develop`` command again, and it will complete + successfully. This is due to a minor bug in SQLAlchemy 0.7.5 under Python + 3, and will be fixed in a later SQLAlchemy release. Keep an eye on + http://www.sqlalchemy.org/trac/ticket/2421 This feature required us to make some compromises. -- cgit v1.2.3 From 1fc45b385c16b39f41ce2a5d220326f87511fb37 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 3 Mar 2012 13:06:57 -0500 Subject: untangle impacts of python 3 compat --- docs/whatsnew-1.3.rst | 144 +++++++++++++++++++++++++++----------------------- 1 file changed, 77 insertions(+), 67 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index cc960f8c1..85bb26ba5 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -15,83 +15,72 @@ The major feature additions in Pyramid 1.3 follow. Python 3 Compatibility ~~~~~~~~~~~~~~~~~~~~~~ -In addition to running on Python 2 (version 2.6 or 2.7 required), Pyramid is -now Python 3 compatible. For Python 3 compatibility, Python 3.2 or better -is required. - -.. warning:: - - As of this writing (the release of Pyramid 1.3b2), if you attempt to - install a Pyramid project that used the ``alchemy`` scaffold via - ``setup.py develop`` on Python 3.2, it will quit with an installation - error while trying to install ``Pygments``. If this happens, please just - rerun the ``setup.py develop`` command again, and it will complete - successfully. This is due to a minor bug in SQLAlchemy 0.7.5 under Python - 3, and will be fixed in a later SQLAlchemy release. Keep an eye on - http://www.sqlalchemy.org/trac/ticket/2421 - -This feature required us to make some compromises. - -Pyramid no longer runs on Python 2.5. This includes the most recent release -of Jython and the Python 2.5 version of Google App Engine. We could not -easily "straddle" Python 2 and 3 versions and support Python 2 versions older -than Python 2.6. You will need Python 2.6 or better to run this version of -Pyramid. If you need to use Python 2.5, you should use the most recent 1.2.X -release of Pyramid. - -Though many Pyramid add-ons have releases which are already Python 3 -compatible (in particular ``pyramid_debugtoolbar``, ``pyramid_jinja2``, -``pyramid_exclog``, and ``pyramid_tm``), some are still known to work only -under Python 2. Likewise, some scaffolding dependencies (particularly ZODB) -do not yet work under Python -3. Please be patient as we gain full ecosystem support for Python 3. You -can see more details about ongoing porting efforts at -https://github.com/Pylons/pyramid/wiki/Python-3-Porting . +Pyramid continues to run on Python 2, but Pyramid is now also Python 3 +compatible. To use Pyramid under Python 3, Python 3.2 or better is required. + +Many Pyramid add-ons are already Python 3 compatible. For example, +``pyramid_debugtoolbar``, ``pyramid_jinja2``, ``pyramid_exclog``, and +``pyramid_tm`` are all Python 3-ready. But some are still known to work only +under Python 2. Also, some scaffolding dependencies (particularly ZODB) do +not yet work under Python 3. + +Python 3 compatibility also required dropping some package dependencies and +support for older Python versions and platforms. See the "Backwards +Incompatibilities" section below for more information. -The libraries named ``Paste`` and ``PasteScript`` which have been -dependencies of Pyramid since 1.0+ have not been ported to Python 3, and we -were unwilling to port and maintain them ourselves. As a result, we've had -to make some changes: +Please be patient as we gain full ecosystem support for Python 3. You can +see more details about ongoing porting efforts at +https://github.com/Pylons/pyramid/wiki/Python-3-Porting . -- We've replaced the ``paster`` command with Pyramid-specific analogues. +The ``paster`` Command Has Been Replaced +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- We've made the default WSGI server used by Pyramid scaffolding the - :term:`waitress` server. +We've replaced the ``paster`` command with Pyramid-specific analogues. Why? +The libraries that supported the ``paster`` command named ``Paste`` and +``PasteScript`` do not run under Python 3, and we were unwilling to port and +maintain them ourselves. As a result, we've had to make some changes. Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application using ``paster create``, like so:: $ myvenv/bin/paster create -t pyramid_starter foo -You're now instead required to create an application using ``pcreate`` like -so:: +In 1.3, you're now instead required to create an application using +``pcreate`` like so:: $ myvenv/bin/pcreate -s starter foo -Note that the names of available scaffolds have changed and the flags -supported by ``pcreate`` are different than those that were supported by +``pcreate`` is required to be used for internal Pyramid scaffolding; +externally distributed scaffolding may allow for both ``pcreate`` and/or ``paster create``. -Instead of running a Pyramid project created via a scaffold using ``paster -serve``, as was done in Pyramid <= 1.2.X, you now must use the ``pserve`` -command:: +In previous Pyramid versions, you ran a Pyramid application like so:: + + $ myvenv/bin/paster serve development.ini + +Instead, you now must use the ``pserve`` command in 1.3:: - $myvenv/bin/pserve development.ini + $ myvenv/bin/pserve development.ini The ``ini`` configuration file format supported by Pyramid has not changed. As a result, Python 2-only users can install PasteScript manually and use ``paster serve`` instead if they like. However, using ``pserve`` will work -under both Python 2 and Python 3. ``pcreate`` is required to be used for -internal Pyramid scaffolding; externally distributed scaffolding may allow -for both ``pcreate`` and/or ``paster create``. +under both Python 2 and Python 3. Analogues of ``paster pshell``, ``paster pviews``, ``paster request`` and ``paster ptweens`` also exist under the respective console script names ``pshell``, ``pviews``, ``prequest`` and ``ptweens``. -We've replaced use of the Paste ``httpserver`` with the ``waitress`` server in -the scaffolds, so once you create a project from a scaffold, its -``development.ini`` and ``production.ini`` will have the following line:: +``paste.httpserver`` replaced by ``waitress`` in Scaffolds +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Because the ``paste.httpserver`` server we used previously in scaffolds is +not Python 3 compatible, we've made the default WSGI server used by Pyramid +scaffolding the :term:`waitress` server. The waitress server is both Python +2 and Python 3 compatible. + +Once you create a project from a scaffold, its ``development.ini`` and +``production.ini`` will have the following line:: use = egg:waitress#main @@ -99,23 +88,23 @@ Instead of this (which was the default in older versions):: use = egg:Paste#http -.. warning:: +.. note:: - Previously, paste.httpserver "helped" by converting header values that - weren't strings to strings. The ``waitress`` server, on the other hand - implements the spec more fully. This specifically may affect you if you - are modifying headers on your response. The following error might be an - indicator of this problem: **AssertionError: Header values must be - strings, please check the type of the header being returned.** A common - case would be returning unicode headers instead of string headers. + ``paste.httpserver`` "helped" by converting header values that were Unicode + into strings, which was a feature that subverted the :term:`WSGI` + specification. The ``waitress`` server, on the other hand implements the + WSGI spec more fully. This specifically may affect you if you are modifying + headers on your responses. The following error might be an indicator of + this problem: **AssertionError: Header values must be strings, please check + the type of the header being returned.** A common case would be returning + Unicode headers instead of string headers. + +Compatibility Helper Library +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A new :mod:`pyramid.compat` module was added which provides Python 2/3 straddling support for Pyramid add-ons and development environments. -Python 3 compatibility required dropping some package dependencies and -support for older Python versions and platforms. See the "Backwards -Incompatibilities" section below for more information. - Introspection ~~~~~~~~~~~~~ @@ -362,8 +351,17 @@ Minor Feature Additions Backwards Incompatibilities --------------------------- -- Pyramid no longer runs on Python 2.5 (which includes the most recent - release of Jython and the Python 2.5 version of GAE as of this writing). +- Pyramid no longer runs on Python 2.5. This includes the most recent + release of Jython and the Python 2.5 version of Google App Engine. + + The reason? We could not easily "straddle" Python 2 and 3 versions and + support Python 2 versions older than Python 2.6. You will need Python 2.6 + or better to run this version of Pyramid. If you need to use Python 2.5, + you should use the most recent 1.2.X release of Pyramid. + +- The names of available scaffolds have changed and the flags supported by + ``pcreate`` are different than those that were supported by ``paster + create``. For example, ``pyramid_alchemy`` is now just ``alchemy``. - The ``paster`` command is no longer the documented way to create projects, start the server, or run debugging commands. To create projects from @@ -485,6 +483,18 @@ Deprecations was designed to offer in Pylons. It will continue to exist "forever" but it will not be recommended or mentioned in the docs. +Known Issues +------------ + +- As of this writing (the release of Pyramid 1.3b2), if you attempt to + install a Pyramid project that used the ``alchemy`` scaffold via ``setup.py + develop`` on Python 3.2, it will quit with an installation error while + trying to install ``Pygments``. If this happens, please just rerun the + ``setup.py develop`` command again, and it will complete successfully. + This is due to a minor bug in SQLAlchemy 0.7.5 under Python 3, and will be + fixed in a later SQLAlchemy release. Keep an eye on + http://www.sqlalchemy.org/trac/ticket/2421 + Documentation Enhancements -------------------------- -- cgit v1.2.3 From 53c242ee3a05eaf9eef7650611c268546e60ebaf Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 18 Mar 2012 17:38:50 -0400 Subject: add python 3 logo --- docs/whatsnew-1.3.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 85bb26ba5..b4138be13 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -15,6 +15,8 @@ The major feature additions in Pyramid 1.3 follow. Python 3 Compatibility ~~~~~~~~~~~~~~~~~~~~~~ +.. image:: python-3.png + Pyramid continues to run on Python 2, but Pyramid is now also Python 3 compatible. To use Pyramid under Python 3, Python 3.2 or better is required. -- cgit v1.2.3 From 731d5f571c2b78a885e176abfd0c16f78ec6bc02 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 20 Mar 2012 14:28:15 -0400 Subject: update --- docs/whatsnew-1.3.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index b4138be13..d90897d16 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -21,19 +21,20 @@ Pyramid continues to run on Python 2, but Pyramid is now also Python 3 compatible. To use Pyramid under Python 3, Python 3.2 or better is required. Many Pyramid add-ons are already Python 3 compatible. For example, -``pyramid_debugtoolbar``, ``pyramid_jinja2``, ``pyramid_exclog``, and -``pyramid_tm`` are all Python 3-ready. But some are still known to work only -under Python 2. Also, some scaffolding dependencies (particularly ZODB) do -not yet work under Python 3. - -Python 3 compatibility also required dropping some package dependencies and -support for older Python versions and platforms. See the "Backwards -Incompatibilities" section below for more information. +``pyramid_debugtoolbar``, ``pyramid_jinja2``, ``pyramid_exclog``, +``pyramid_tm``, ``pyramid_mailer``, and ``pyramid_handlers`` are all Python +3-ready. But other add-ons are known to work only under Python 2. Also, +some scaffolding dependencies (particularly ZODB) do not yet work under +Python 3. Please be patient as we gain full ecosystem support for Python 3. You can see more details about ongoing porting efforts at https://github.com/Pylons/pyramid/wiki/Python-3-Porting . +Python 3 compatibility required dropping some package dependencies and +support for older Python versions and platforms. See the "Backwards +Incompatibilities" section below for more information. + The ``paster`` Command Has Been Replaced ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 01c76b8bf509bbad41336d00d832241e7e02aa9e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 13 Nov 2012 17:41:45 -0500 Subject: forward port from 1.3 branch --- docs/whatsnew-1.3.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index d90897d16..14db1fe15 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -486,6 +486,11 @@ Deprecations was designed to offer in Pylons. It will continue to exist "forever" but it will not be recommended or mentioned in the docs. +- Remove references to do-nothing ``pyramid.debug_templates`` setting in all + Pyramid-provided .ini files. This setting previously told Chameleon to render + better exceptions; now Chameleon always renders nice exceptions regardless of + the value of this setting. + Known Issues ------------ -- cgit v1.2.3 From a5b23b06b9dcd6157b9e97bfd65ff9ced0299afd Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 14 Nov 2012 01:09:40 -0500 Subject: remove duplicate whatsnew entry (forward port from 1.3 branch --- docs/whatsnew-1.3.rst | 7 ------- 1 file changed, 7 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 14db1fe15..f32053202 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -289,13 +289,6 @@ Minor Feature Additions not a new feature, it just provides an API for adding a resource url adapter without needing to use the ZCA API. -- The :meth:`pyramid.config.Configurator.scan` method can now be passed an - ``ignore`` argument, which can be a string, a callable, or a list - consisting of strings and/or callables. This feature allows submodules, - subpackages, and global objects from being scanned. See - http://readthedocs.org/docs/venusian/en/latest/#ignore-scan-argument for - more information about how to use the ``ignore`` argument to ``scan``. - - Better error messages when a view callable returns a value that cannot be converted to a response (for example, when a view callable returns a dictionary without a renderer defined, or doesn't return any value at all). -- cgit v1.2.3 From 8087fb7b72a8642ce3a323692b828d87369cff9f Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 19 Feb 2013 23:40:04 +0200 Subject: fix broken links --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index f32053202..dfc7b4f4b 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -524,7 +524,7 @@ Documentation Enhancements - Removed the "Running Pyramid on Google App Engine" tutorial from the main docs. It survives on in the Cookbook - (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/gae.html). + (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/gae.html). Rationale: it provides the correct info for the Python 2.5 version of GAE only, and this version of Pyramid does not support Python 2.5. -- cgit v1.2.3 From c0f9371e351431ff6f4eb25a60028cad987efb27 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 23 Feb 2013 17:02:55 +0200 Subject: this has since been fixed --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index f32053202..a4f259592 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -492,7 +492,7 @@ Known Issues develop`` on Python 3.2, it will quit with an installation error while trying to install ``Pygments``. If this happens, please just rerun the ``setup.py develop`` command again, and it will complete successfully. - This is due to a minor bug in SQLAlchemy 0.7.5 under Python 3, and will be + This is due to a minor bug in SQLAlchemy 0.7.5 under Python 3, and has been fixed in a later SQLAlchemy release. Keep an eye on http://www.sqlalchemy.org/trac/ticket/2421 -- cgit v1.2.3 From 2f4bdefd18073c418ae95fe9e5a8c7b2a9d1130e Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sat, 9 Mar 2013 03:06:17 +0200 Subject: capitalize; add term role --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index f32053202..a73e2969d 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -212,7 +212,7 @@ Not Found helpers: - New API: :meth:`pyramid.config.Configurator.add_notfound_view`. This is a wrapper for :meth:`pyramid.Config.configurator.add_view` which provides support for an "append_slash" feature as well as doing the right thing when - it comes to permissions (a not found view should always be public). It + it comes to permissions (a Not Found View should always be public). It should be preferred over calling ``add_view`` directly with ``context=HTTPNotFound`` as was previously recommended. -- cgit v1.2.3 From f73f0e332658fac2583f51247dcd49bd36d63ce4 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 13 Mar 2013 23:05:17 +0200 Subject: consistency: use $VENV whenever virtualenv binaries are used --- docs/whatsnew-1.3.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index d121413e2..ef0256383 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -46,12 +46,12 @@ maintain them ourselves. As a result, we've had to make some changes. Previously (in Pyramid 1.0, 1.1 and 1.2), you created a Pyramid application using ``paster create``, like so:: - $ myvenv/bin/paster create -t pyramid_starter foo + $ $VENV/bin/paster create -t pyramid_starter foo In 1.3, you're now instead required to create an application using ``pcreate`` like so:: - $ myvenv/bin/pcreate -s starter foo + $ $VENV/bin/pcreate -s starter foo ``pcreate`` is required to be used for internal Pyramid scaffolding; externally distributed scaffolding may allow for both ``pcreate`` and/or @@ -59,11 +59,11 @@ externally distributed scaffolding may allow for both ``pcreate`` and/or In previous Pyramid versions, you ran a Pyramid application like so:: - $ myvenv/bin/paster serve development.ini + $ $VENV/bin/paster serve development.ini Instead, you now must use the ``pserve`` command in 1.3:: - $ myvenv/bin/pserve development.ini + $ $VENV/bin/pserve development.ini The ``ini`` configuration file format supported by Pyramid has not changed. As a result, Python 2-only users can install PasteScript manually and use -- cgit v1.2.3 From 057a6c9d452fbe04c0bc7fc80aec79cd0d2c30e4 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 31 Mar 2013 11:11:34 +0200 Subject: fix some cross-references --- docs/whatsnew-1.3.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index ef0256383..2606c3df3 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -210,13 +210,13 @@ Not Found and Forbidden View Helpers Not Found helpers: - New API: :meth:`pyramid.config.Configurator.add_notfound_view`. This is a - wrapper for :meth:`pyramid.Config.configurator.add_view` which provides + wrapper for :meth:`pyramid.config.Configurator.add_view` which provides support for an "append_slash" feature as well as doing the right thing when it comes to permissions (a Not Found View should always be public). It should be preferred over calling ``add_view`` directly with ``context=HTTPNotFound`` as was previously recommended. -- New API: :class:`pyramid.view.notfound_view_config``. This is a decorator +- New API: :class:`pyramid.view.notfound_view_config`. This is a decorator constructor like :class:`pyramid.view.view_config` that calls :meth:`pyramid.config.Configurator.add_notfound_view` when scanned. It should be preferred over using ``pyramid.view.view_config`` with @@ -225,7 +225,7 @@ Not Found helpers: Forbidden helpers: - New API: :meth:`pyramid.config.Configurator.add_forbidden_view`. This is a - wrapper for :meth:`pyramid.Config.configurator.add_view` which does the + wrapper for :meth:`pyramid.config.Configurator.add_view` which does the right thing about permissions. It should be preferred over calling ``add_view`` directly with ``context=HTTPForbidden`` as was previously recommended. @@ -267,7 +267,7 @@ Minor Feature Additions - We allow extra keyword arguments to be passed to the :meth:`pyramid.config.Configurator.action` method. -- Responses generated by Pyramid's :class:`pyramid.views.static_view` now use +- Responses generated by Pyramid's :class:`pyramid.static.static_view` now use a ``wsgi.file_wrapper`` (see http://www.python.org/dev/peps/pep-0333/#optional-platform-specific-file-handling) when one is provided by the web server. @@ -389,8 +389,8 @@ Backwards Incompatibilities and upgrade Pyramid itself "in-place"; it may simply break instead (particularly if you use ZCML's ``includeOverrides`` directive). -- String values passed to :meth:`Pyramid.request.Request.route_url` or - :meth:`Pyramid.request.Request.route_path` that are meant to replace +- String values passed to :meth:`pyramid.request.Request.route_url` or + :meth:`pyramid.request.Request.route_path` that are meant to replace "remainder" matches will now be URL-quoted except for embedded slashes. For example:: -- cgit v1.2.3 From 41aeac4b9442a03c961b85b896ae84a8da3dbc9c Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sun, 3 Jan 2016 01:06:35 -0600 Subject: fix grammar on whatsnew document titles --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 2606c3df3..1a299e126 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -1,4 +1,4 @@ -What's New In Pyramid 1.3 +What's New in Pyramid 1.3 ========================= This article explains the new features in :app:`Pyramid` version 1.3 as -- cgit v1.2.3 From 34515f33b3e391dd1c0c727bf5ef4af586b57889 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 14 Jan 2016 02:55:04 -0800 Subject: Rename Cookbook to Pyramid Community Cookbook - use .rst intersphinx labels for pages instead of broken URLs --- docs/whatsnew-1.3.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index 1a299e126..dd3e1b8dd 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -523,10 +523,11 @@ Documentation Enhancements :ref:`making_a_console_script`. - Removed the "Running Pyramid on Google App Engine" tutorial from the main - docs. It survives on in the Cookbook - (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/gae.html). - Rationale: it provides the correct info for the Python 2.5 version of GAE - only, and this version of Pyramid does not support Python 2.5. + docs. It survives on in the Pyramid Community Cookbook as + :ref:`Pyramid on Google's App Engine (using appengine-monkey) + `. Rationale: it provides the correct info for + the Python 2.5 version of GAE only, and this version of Pyramid does not + support Python 2.5. - Updated the :ref:`changing_the_forbidden_view` section, replacing explanations of registering a view using ``add_view`` or ``view_config`` -- cgit v1.2.3 From 4064028cadc63ed1aceb14e6c88827b88b12f839 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 20 Jan 2016 00:38:09 -0800 Subject: Update docs to reflect dropping Python 3.2 support --- docs/whatsnew-1.3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/whatsnew-1.3.rst') diff --git a/docs/whatsnew-1.3.rst b/docs/whatsnew-1.3.rst index dd3e1b8dd..8de69c450 100644 --- a/docs/whatsnew-1.3.rst +++ b/docs/whatsnew-1.3.rst @@ -18,7 +18,7 @@ Python 3 Compatibility .. image:: python-3.png Pyramid continues to run on Python 2, but Pyramid is now also Python 3 -compatible. To use Pyramid under Python 3, Python 3.2 or better is required. +compatible. To use Pyramid under Python 3, Python 3.3 or better is required. Many Pyramid add-ons are already Python 3 compatible. For example, ``pyramid_debugtoolbar``, ``pyramid_jinja2``, ``pyramid_exclog``, -- cgit v1.2.3