Home | History | Annotate | Download | only in jinja2

Lines Matching defs:For

13     :license: BSD, see LICENSE for more details.
23 #: the types we support for context functions
60 """A metaclass for nodes that handles the field and attribute
65 for attr in 'fields', 'attributes':
108 """Baseclass for all Jinja2 nodes. There are a number of nodes available
120 The `environment` attribute is set at the end of the parsing process for
140 for name, arg in izip(self.fields, fields):
142 for attr in self.attributes:
155 for name in self.fields:
169 for field, item in self.iter_fields(exclude, only):
171 for n in item:
181 for result in self.find_all(node_type):
186 the check is performed for any of the tuple items.
188 for child in self.iter_child_nodes():
191 for result in child.find_all(node_type):
220 """Set the environment for all nodes."""
241 ', '.join('%s=%r' % (arg, getattr(self, arg, None)) for
247 """Base node for all statements."""
265 This is used both for the `print` statement and the regular template data.
275 class For(Stmt):
276 """The for loop. `target` is the target for the iteration (usually a
278 of nodes that are used as loop-body, and `else_` a list of nodes for the
281 For filtered nodes an expression can be stored as `test`, otherwise `None`.
294 a list of nodes for the macro body.
307 """Node for filter sections."""
332 problem for regular Jinja code, but if this node is used in an extension
351 """Baseclass for all expressions."""
373 """Baseclass for all binary expressions."""
392 """Baseclass for all unary expressions."""
426 """Baseclass for literals."""
431 """All constant values. The parser will return this node for simple
467 """For loop unpacking and some other things like multiple arguments
468 for subscripts. Like for :class:`Name` `ctx` specifies if the tuple
469 is used for loading the names or storing.
475 return tuple(x.as_const(eval_ctx) for x in self.items)
478 for item in self.items:
490 return [x.as_const(eval_ctx) for x in self.items]
501 return dict(x.as_const(eval_ctx) for x in self.items)
505 """A key, value pair for dicts."""
514 """A key, value pair for keyword arguments where key is a string."""
542 the filter, the rest of the fields are the same as for :class:`Call`.
562 args = [x.as_const(eval_ctx) for x in self.args]
567 kwargs = dict(x.as_const(eval_ctx) for x in self.kwargs)
586 rest of the fields are the same as for :class:`Call`.
595 node for dynamic positional (``*args``) or keyword (``**kwargs``)
607 args = [x.as_const(eval_ctx) for x in self.args]
616 kwargs = dict(x.as_const(eval_ctx) for x in self.kwargs)
672 """Represents a slice object. This must only be used as argument for
694 return ''.join(text_type(x.as_const(eval_ctx)) for x in self.nodes)
707 for op in self.ops:
722 ', '.join(sorted('``%s``' % x for x in set(_binop_to_func) |
792 """Make the expression positive (noop for most expressions)"""
796 # Helpers for extensions
800 """Loads an attribute from the environment object. This is useful for
818 access. For example ``ImportedName('cgi.escape')`` returns the `escape`
829 a new identifier for you. This identifier is not available from the
893 """Modifies the eval context. For each option that should be modified,
906 :class:`~jinja2.nodes.EvalContext` for nodes in the :attr:`body`.