Given a template t:
t=Template('{{ foo }}{{ bar }}')
t.render(foo=1) # an UndefinedVariableError('variable bar is undefined')
should be raised here
t.render(foo=1, bar=2) # normal output: '12'
t.render(foo=1, bar=2, foobar=3) # a TooManyVariablesError('there is no
variable named boobar') should be raised here.
When my template get larger, I sometime pass more or less argument than
needed.
Is it possible to raise an exception like this?
Thanks,
Cosmia
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pocoo-libs/-/LQpMLEOPND4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.