comparison examples/doctest.txt @ 36:0cba953a03ca

fixed single-file test case
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 01 Jan 2011 22:13:33 -0800
parents 7e47ff4b0cd3
children 7cee2869bd7b
comparison
equal deleted inserted replaced
35:7e47ff4b0cd3 36:0cba953a03ca
12 12
13 >>> template = makeitso.PolyTemplate([example], interactive=False) 13 >>> template = makeitso.PolyTemplate([example], interactive=False)
14 >>> template.missing() 14 >>> template.missing()
15 set(['name']) 15 set(['name'])
16 >>> template.substitute(name='foo') 16 >>> template.substitute(name='foo')
17 None 17 Hello foo
18 18
19 Substitute to a buffer: 19 Substitute to a buffer:
20 20
21 >>> buffer = StringIO() 21 >>> buffer = StringIO()
22 >>> template = makeitso.PolyTemplate([example], output=buffer, interactive=False) 22 >>> template = makeitso.PolyTemplate([example], output=buffer, interactive=False)
23 >>> template.substitute(name='bar') 23 >>> template.substitute(name='bar')
24 None 24 >>> buffer.getvalue().strip()
25 >>> buffer.getvalue() 25 'Hello bar'
26 26