Skip to content
Myr

fixed some NameErrors

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Benjamin Wiegand · committed by Benjamin Wiegand · parent 157531b · Browse files · 6 files+12 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+12 added−4 removed

  • other:+12 added−4 removed

6 files+12 added−4 removed

modified:jinja2/exceptions.py+6 added
43 unmodified lines
444546class TemplateRuntimeError(TemplateError):47 """A runtime error."""484950class FilterArgumentError(Exception):51 """This error is raised if a filter was called with inappropriate52 arguments53 """
modified:jinja2/ext.py+1 added-1 removed
13 unmodified lines
14from jinja2 import nodes15from jinja2.environment import get_spontaneous_environment16from jinja2.runtime import Undefined, concat17from jinja2.parser import statement_end_tokens18from jinja2.exceptions import TemplateAssertionError18from jinja2.exceptions import TemplateAssertionError, TemplateSyntaxError19from jinja2.utils import import_string, Markup202122# the only real useful gettext functions for a Jinja template. Note
272 unmodified lines
modified:jinja2/filters.py+1 added
17 unmodified lines
18from urllib import urlencode, quote19from itertools import imap, groupby20from jinja2.utils import Markup, escape, pformat, urlize, soft_unicode21from jinja2.runtime import Undefined22from jinja2.exceptions import FilterArgumentError232425_striptags_re = re.compile(r'(<!--.*?-->|<[^>]*>)')26
647 unmodified lines
modified:jinja2/nodes.py+2 added-1 removed
502 unmodified lines
503 def as_const(self):504 if self.ctx != 'load':505 raise Impossible()506 try:507 return environmen.subscribe(self.node.as_const(), self.arg.as_const())507 return self.environment.subscribe(self.node.as_const(),508 self.arg.as_const())509 except:510 raise Impossible()511512 def can_assign(self):
108 unmodified lines
modified:jinja2/parser.py+1 added-1 removed
533 unmodified lines
534 self.stream.expect('rbracket')535 if len(args) == 1:536 arg = args[0]537 else:538 arg = nodes.Tuple(args, lineno, self.filename)538 arg = nodes.Tuple(args, self.lineno, self.filename)539 else:540 raise TemplateSyntaxError('expected subscript expression',541 self.lineno, self.filename)542 return nodes.Subscript(node, arg, 'load', lineno=token.lineno)
161 unmodified lines
modified:jinja2/utils.py+1 added-1 removed
410 unmodified lines
411try:412 from functools import partial413except ImportError:414 class partial(object):415 def __init__(self, _func, *args, **kwargs):415 def __init__(self, func, *args, **kwargs):416 self._func = func417 self._args = args418 self._kwargs = kwargs419 def __call__(self, *args, **kwargs):
2 unmodified lines