summaryrefslogtreecommitdiff
path: root/docs/narr
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2015-02-17 19:37:52 -0500
committerChris McDonough <chrism@plope.com>2015-02-17 19:37:52 -0500
commitd4333972ad328f06262ba55ef2a3d24963da95b0 (patch)
treec208aafc07a03934307019120910c3a576982978 /docs/narr
parentb63f0c5f6e2f322bd9183d194b4aa774f9f4e93f (diff)
parent4dacb8c24efe98cb14b3ef89f6c9a8b2fd196790 (diff)
downloadpyramid-d4333972ad328f06262ba55ef2a3d24963da95b0.tar.gz
pyramid-d4333972ad328f06262ba55ef2a3d24963da95b0.tar.bz2
pyramid-d4333972ad328f06262ba55ef2a3d24963da95b0.zip
fix merge conflicts
Diffstat (limited to 'docs/narr')
-rw-r--r--docs/narr/assets.rst15
-rw-r--r--docs/narr/hooks.rst9
2 files changed, 14 insertions, 10 deletions
diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst
index fc908c2b4..d6bc8cbb8 100644
--- a/docs/narr/assets.rst
+++ b/docs/narr/assets.rst
@@ -446,19 +446,20 @@ In order to implement your own cache buster, you can write your own class from
scratch which implements the :class:`~pyramid.interfaces.ICacheBuster`
interface. Alternatively you may choose to subclass one of the existing
implementations. One of the most likely scenarios is you'd want to change the
-way the asset token is generated. To do this just subclass an existing
-implementation and replace the :meth:`~pyramid.interfaces.ICacheBuster.token`
-method. Here is an example which just uses Git to get the hash of the
-currently checked out code:
+way the asset token is generated. To do this just subclass either
+:class:`~pyramid.static.PathSegmentCacheBuster` or
+:class:`~pyramid.static.QueryStringCacheBuster` and define a
+``tokenize(pathspec)`` method. Here is an example which just uses Git to get
+the hash of the currently checked out code:
.. code-block:: python
:linenos:
import os
import subprocess
- from pyramid.static import PathSegmentMd5CacheBuster
+ from pyramid.static import PathSegmentCacheBuster
- class GitCacheBuster(PathSegmentMd5CacheBuster):
+ class GitCacheBuster(PathSegmentCacheBuster):
"""
Assuming your code is installed as a Git checkout, as opposed to as an
egg from an egg repository like PYPI, you can use this cachebuster to
@@ -470,7 +471,7 @@ currently checked out code:
['git', 'rev-parse', 'HEAD'],
cwd=here).strip()
- def token(self, pathspec):
+ def tokenize(self, pathspec):
return self.sha1
Choosing a Cache Buster
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 17cae2c67..4fd7670b9 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -364,9 +364,12 @@ Whenever :app:`Pyramid` returns a response from a view it creates a
object.
The factory that :app:`Pyramid` uses to create a response object instance can be
-changed by passing a ``response_factory`` argument to the constructor of the
-:term:`configurator`. This argument can be either a callable or a
-:term:`dotted Python name` representing a callable.
+changed by passing a :class:`pyramid.interfaces.IResponseFactory` argument to
+the constructor of the :term:`configurator`. This argument can be either a
+callable or a :term:`dotted Python name` representing a callable.
+
+The factory takes a single positional argument, which is a :term:`Request`
+object. The argument may be ``None``.
.. code-block:: python
:linenos: