MCPcopy Index your code
hub / github.com/nodejs/node / Environment

Class Environment

tools/inspector_protocol/jinja2/environment.py:113–886  ·  view source on GitHub ↗

r"""The core component of Jinja is the `Environment`. It contains important shared variables like configuration, filters, tests, globals and others. Instances of this class may be modified if they are not shared and if no template was loaded so far. Modifications on environments af

Source from the content-addressed store, hash-verified

111
112
113class Environment(object):
114 r"""The core component of Jinja is the `Environment`. It contains
115 important shared variables like configuration, filters, tests,
116 globals and others. Instances of this class may be modified if
117 they are not shared and if no template was loaded so far.
118 Modifications on environments after the first template was loaded
119 will lead to surprising effects and undefined behavior.
120
121 Here are the possible initialization parameters:
122
123 `block_start_string`
124 The string marking the beginning of a block. Defaults to ``'{%'``.
125
126 `block_end_string`
127 The string marking the end of a block. Defaults to ``'%}'``.
128
129 `variable_start_string`
130 The string marking the beginning of a print statement.
131 Defaults to ``'{{'``.
132
133 `variable_end_string`
134 The string marking the end of a print statement. Defaults to
135 ``'}}'``.
136
137 `comment_start_string`
138 The string marking the beginning of a comment. Defaults to ``'{#'``.
139
140 `comment_end_string`
141 The string marking the end of a comment. Defaults to ``'#}'``.
142
143 `line_statement_prefix`
144 If given and a string, this will be used as prefix for line based
145 statements. See also :ref:`line-statements`.
146
147 `line_comment_prefix`
148 If given and a string, this will be used as prefix for line based
149 comments. See also :ref:`line-statements`.
150
151 .. versionadded:: 2.2
152
153 `trim_blocks`
154 If this is set to ``True`` the first newline after a block is
155 removed (block, not variable tag!). Defaults to `False`.
156
157 `lstrip_blocks`
158 If this is set to ``True`` leading spaces and tabs are stripped
159 from the start of a line to a block. Defaults to `False`.
160
161 `newline_sequence`
162 The sequence that starts a newline. Must be one of ``'\r'``,
163 ``'\n'`` or ``'\r\n'``. The default is ``'\n'`` which is a
164 useful default for Linux and OS X systems as well as web
165 applications.
166
167 `keep_trailing_newline`
168 Preserve the trailing newline when rendering templates.
169 The default is ``False``, which causes a single newline,
170 if present, to be stripped from the end of the template.

Callers 2

babel_extractFunction · 0.90

Calls 1

propertyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…