Commit 62d1264b by Chris Jerdonek

Merge 'issue_63' into development: closing issue #63 (doctests)

Doctests now pass, and they pass running "nosetests --with-doctest".
parents 78ecd844 17d62ebc
......@@ -15,7 +15,7 @@ Python 2.6.
Pystache is semantically versioned: http://semver.org.
Logo: David Phillips - http://davidphillips.us/
Logo: David Phillips - http://davidphillips.us/
Documentation
=============
......@@ -65,7 +65,7 @@ nose_ works great! ::
pip install nose
cd pystache
nosetests
nosetests --with-doctest
Mailing List
......
......@@ -27,12 +27,14 @@ class Modifiers(dict):
"""
Return a decorator that assigns the given function to the given key.
>>> modifiers = {}
>>> modifiers = Modifiers()
>>>
>>> @modifiers.set('P')
... def render_tongue(self, tag_name=None, context=None):
... return ":P %s" % tag_name
>>> modifiers
{'P': <function render_tongue at 0x...>}
... def render_tongue(tag_name, context):
... return "%s :P" % context.get(tag_name)
>>>
>>> modifiers['P']('text', {'text': 'hello!'})
'hello! :P'
"""
def decorate(func):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment