summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-03-25 02:03:31 -0700
committerChris McDonough <chrism@plope.com>2013-03-25 02:03:31 -0700
commitb4c0d4f0574b45c88f66530548ecaa7d6ad0baef (patch)
treef0c39c064fd55b1141c7e96a62ae80a290acd8ff
parent31c4e1d91973a18f36a3859d0b449aee36323728 (diff)
parent88cafdd3cf621d0a117f0e2e8c924c07dfbf5ef1 (diff)
downloadpyramid-b4c0d4f0574b45c88f66530548ecaa7d6ad0baef.tar.gz
pyramid-b4c0d4f0574b45c88f66530548ecaa7d6ad0baef.tar.bz2
pyramid-b4c0d4f0574b45c88f66530548ecaa7d6ad0baef.zip
Merge pull request #940 from tshepang/diff
no need to qualify Python interactive sessions
-rw-r--r--docs/narr/sessions.rst43
-rw-r--r--pyramid/decorator.py18
-rw-r--r--pyramid/util.py21
3 files changed, 34 insertions, 48 deletions
diff --git a/docs/narr/sessions.rst b/docs/narr/sessions.rst
index fa4affd8a..c4f4b5f07 100644
--- a/docs/narr/sessions.rst
+++ b/docs/narr/sessions.rst
@@ -252,25 +252,19 @@ that were added to the flash queue, and empties the queue.
.. method:: pop_flash(queue='')
-.. code-block:: python
- :linenos:
-
- >>> request.session.flash('info message')
- >>> request.session.pop_flash()
- ['info message']
+>>> request.session.flash('info message')
+>>> request.session.pop_flash()
+['info message']
Calling ``session.pop_flash()`` again like above without a corresponding call
to ``session.flash()`` will return an empty list, because the queue has already
been popped.
-.. code-block:: python
- :linenos:
-
- >>> request.session.flash('info message')
- >>> request.session.pop_flash()
- ['info message']
- >>> request.session.pop_flash()
- []
+>>> request.session.flash('info message')
+>>> request.session.pop_flash()
+['info message']
+>>> request.session.pop_flash()
+[]
.. index::
single: session.peek_flash
@@ -285,18 +279,15 @@ popped from flash storage.
.. method:: peek_flash(queue='')
-.. code-block:: python
- :linenos:
-
- >>> request.session.flash('info message')
- >>> request.session.peek_flash()
- ['info message']
- >>> request.session.peek_flash()
- ['info message']
- >>> request.session.pop_flash()
- ['info message']
- >>> request.session.peek_flash()
- []
+>>> request.session.flash('info message')
+>>> request.session.peek_flash()
+['info message']
+>>> request.session.peek_flash()
+['info message']
+>>> request.session.pop_flash()
+['info message']
+>>> request.session.peek_flash()
+[]
.. index::
single: preventing cross-site request forgery attacks
diff --git a/pyramid/decorator.py b/pyramid/decorator.py
index 82d2b1280..e5f2996dc 100644
--- a/pyramid/decorator.py
+++ b/pyramid/decorator.py
@@ -15,16 +15,14 @@ class reify(object):
And usage of Foo:
- .. code-block:: text
-
- >>> f = Foo()
- >>> v = f.jammy
- 'jammy called'
- >>> print v
- 1
- >>> f.jammy
- 1
- >>> # jammy func not called the second time; it replaced itself with 1
+ >>> f = Foo()
+ >>> v = f.jammy
+ 'jammy called'
+ >>> print v
+ 1
+ >>> f.jammy
+ 1
+ >>> # jammy func not called the second time; it replaced itself with 1
"""
def __init__(self, wrapped):
self.wrapped = wrapped
diff --git a/pyramid/util.py b/pyramid/util.py
index 56049af87..02bd7ba2a 100644
--- a/pyramid/util.py
+++ b/pyramid/util.py
@@ -234,18 +234,15 @@ def object_description(object):
""" Produce a human-consumable text description of ``object``,
usually involving a Python dotted name. For example:
- .. code-block:: python
-
- >>> object_description(None)
- u'None'
- >>> from xml.dom import minidom
- >>> object_description(minidom)
- u'module xml.dom.minidom'
- >>> object_description(minidom.Attr)
- u'class xml.dom.minidom.Attr'
- >>> object_description(minidom.Attr.appendChild)
- u'method appendChild of class xml.dom.minidom.Attr'
- >>>
+ >>> object_description(None)
+ u'None'
+ >>> from xml.dom import minidom
+ >>> object_description(minidom)
+ u'module xml.dom.minidom'
+ >>> object_description(minidom.Attr)
+ u'class xml.dom.minidom.Attr'
+ >>> object_description(minidom.Attr.appendChild)
+ u'method appendChild of class xml.dom.minidom.Attr'
If this method cannot identify the type of the object, a generic
description ala ``object <object.__name__>`` will be returned.