From 4149a0e8b7375e12c24dee7be9842fddc61059a6 Mon Sep 17 00:00:00 2001 From: Priit Laes <plaes@plaes.org> Date: Thu, 17 Apr 2008 19:04:44 +0200 Subject: [PATCH] fixed two typos --HG-- branch : trunk --- jinja2/exceptions.py | 2 +- jinja2/filters.py | 2 +- jinja2/runtime.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/jinja2/exceptions.py b/jinja2/exceptions.py index efa9e89..b4c87da 100644 --- a/jinja2/exceptions.py +++ b/jinja2/exceptions.py @@ -30,7 +30,7 @@ class TemplateSyntaxError(TemplateError): """Raised to tell the user that there is a problem with the template.""" def __init__(self, message, lineno, name): - TEmplateError.__init__(self, '%s (line %s)' % (message, lineno)) + TemplateError.__init__(self, '%s (line %s)' % (message, lineno)) self.message = message self.lineno = lineno self.name = name diff --git a/jinja2/filters.py b/jinja2/filters.py index df1d898..56a2e02 100644 --- a/jinja2/filters.py +++ b/jinja2/filters.py @@ -208,7 +208,7 @@ def do_join(value, d=u''): """ # if the delimiter doesn't have an html representation we check # if any of the items has. If yes we do a coercion to Markup - if not hasttr(d, '__html__'): + if not hasattr(d, '__html__'): value = list(value) do_escape = False for idx, item in enumerate(value): diff --git a/jinja2/runtime.py b/jinja2/runtime.py index 31c17f0..8e407c9 100644 --- a/jinja2/runtime.py +++ b/jinja2/runtime.py @@ -301,7 +301,7 @@ class Undefined(object): return self.__unicode__().encode('utf-8') def __repr__(self): - return 'undefined' + return 'Undefined' def __len__(self): return 0 @@ -329,6 +329,9 @@ class DebugUndefined(Undefined): class StrictUndefined(Undefined): - """An undefined that barks on print and iteration.""" + """An undefined that barks on print and iteration as well as boolean tests. + In other words: you can do nothing with it except checking if it's defined + using the `defined` test. + """ - __iter__ = __unicode__ = __len__ = Undefined._fail_with_error + __iter__ = __unicode__ = __len__ = __nonzero__ = Undefined._fail_with_error -- 2.26.2