Home | History | Annotate | Download | only in jinja2

Lines Matching defs:If

54     """Raised if the node could not perform a requested action."""
81 if callable(environment.autoescape):
96 if ctx is None:
97 if node.environment is None:
98 raise RuntimeError('if no eval context is passed, the '
127 if self.abstract:
129 if fields:
130 if len(fields) != len(self.fields):
131 if not self.fields:
143 if attributes:
155 if (exclude is only is None) or \
165 over all fields and yields the values of they are nodes. If the value
169 if isinstance(item, list):
171 if isinstance(n, Node):
177 """Find the first node of a given type. If no such node exists the
184 """Find all the nodes of a given type. If the type is a tuple,
188 if isinstance(child, node_type):
202 if 'ctx' in node.fields:
212 if 'lineno' in node.attributes:
213 if node.lineno is None or override:
275 `else` block. If no else node exists it has to be an empty list.
282 class If(Stmt):
283 """If `test` is true, `body` is rendered, else `else_`."""
289 arguments and `defaults` a list of defaults if there are any. `body` is
328 problem for regular Jinja code, but if this node is used in an extension
331 The list of names may contain tuples if aliases are wanted.
352 :exc:`Impossible` if this was not possible.
354 An :class:`EvalContext` can be provided, if none is given
364 """Check if it's possible to assign something to this node."""
377 if self.environment.sandboxed and \
396 if self.environment.sandboxed and \
412 - `param`: like `store` but if the name was defined as function parameter.
439 """Return a const object if the value is representable as
444 if not has_safe_repr(value):
455 if eval_ctx.volatile:
457 if eval_ctx.autoescape:
464 for subscripts. Like for :class:`Name` `ctx` specifies if the tuple
475 if not item.can_assign():
519 """A conditional expression (inline if expression). (``{{
520 foo if bar else baz }}``)
526 if self.test.as_const(eval_ctx):
529 # if we evaluate to an undefined object, we better do that at runtime
530 if self.expr2 is None:
540 If the `node` of a filter is `None` the contents of the last buffer are
547 if eval_ctx.volatile or self.node is None:
550 # if this variable would be called filter, 2to3 would wrap the
555 if filter_ is None or getattr(filter_, 'contextfilter', False):
559 if getattr(filter_, 'evalcontextfilter', False):
564 if self.dyn_args is not None:
569 if self.dyn_kwargs is not None:
598 if eval_ctx.volatile:
604 if isinstance(obj, _context_function_types):
605 if getattr(obj, 'contextfunction', False):
613 if self.dyn_args is not None:
618 if self.dyn_kwargs is not None:
635 if self.ctx != 'load':
654 if self.ctx != 'load':
676 if obj is None:
716 if __debug__:
813 """If created with an import name the import name is returned on node
846 only if autoescaping is active.
854 if eval_ctx.volatile:
857 if eval_ctx.autoescape: