MCPcopy Create free account
hub / github.com/nodejs/node / __init__

Method __init__

deps/v8/third_party/jinja2/environment.py:292–366  ·  view source on GitHub ↗
(
        self,
        block_start_string: str = BLOCK_START_STRING,
        block_end_string: str = BLOCK_END_STRING,
        variable_start_string: str = VARIABLE_START_STRING,
        variable_end_string: str = VARIABLE_END_STRING,
        comment_start_string: str = COMMENT_START_STRING,
        comment_end_string: str = COMMENT_END_STRING,
        line_statement_prefix: t.Optional[str] = LINE_STATEMENT_PREFIX,
        line_comment_prefix: t.Optional[str] = LINE_COMMENT_PREFIX,
        trim_blocks: bool = TRIM_BLOCKS,
        lstrip_blocks: bool = LSTRIP_BLOCKS,
        newline_sequence: "te.Literal['\\n', '\\r\\n', '\\r']" = NEWLINE_SEQUENCE,
        keep_trailing_newline: bool = KEEP_TRAILING_NEWLINE,
        extensions: t.Sequence[t.Union[str, t.Type["Extension"]]] = (),
        optimized: bool = True,
        undefined: t.Type[Undefined] = Undefined,
        finalize: t.Optional[t.Callable[..., t.Any]] = None,
        autoescape: t.Union[bool, t.Callable[[t.Optional[str]], bool]] = False,
        loader: t.Optional["BaseLoader"] = None,
        cache_size: int = 400,
        auto_reload: bool = True,
        bytecode_cache: t.Optional["BytecodeCache"] = None,
        enable_async: bool = False,
    )

Source from the content-addressed store, hash-verified

290 template_class: t.Type["Template"]
291
292 def __init__(
293 self,
294 block_start_string: str = BLOCK_START_STRING,
295 block_end_string: str = BLOCK_END_STRING,
296 variable_start_string: str = VARIABLE_START_STRING,
297 variable_end_string: str = VARIABLE_END_STRING,
298 comment_start_string: str = COMMENT_START_STRING,
299 comment_end_string: str = COMMENT_END_STRING,
300 line_statement_prefix: t.Optional[str] = LINE_STATEMENT_PREFIX,
301 line_comment_prefix: t.Optional[str] = LINE_COMMENT_PREFIX,
302 trim_blocks: bool = TRIM_BLOCKS,
303 lstrip_blocks: bool = LSTRIP_BLOCKS,
304 newline_sequence: "te.Literal['\\n', '\\r\\n', '\\r']" = NEWLINE_SEQUENCE,
305 keep_trailing_newline: bool = KEEP_TRAILING_NEWLINE,
306 extensions: t.Sequence[t.Union[str, t.Type["Extension"]]] = (),
307 optimized: bool = True,
308 undefined: t.Type[Undefined] = Undefined,
309 finalize: t.Optional[t.Callable[..., t.Any]] = None,
310 autoescape: t.Union[bool, t.Callable[[t.Optional[str]], bool]] = False,
311 loader: t.Optional["BaseLoader"] = None,
312 cache_size: int = 400,
313 auto_reload: bool = True,
314 bytecode_cache: t.Optional["BytecodeCache"] = None,
315 enable_async: bool = False,
316 ):
317 # !!Important notice!!
318 # The constructor accepts quite a few arguments that should be
319 # passed by keyword rather than position. However it's important to
320 # not change the order of arguments because it's used at least
321 # internally in those cases:
322 # - spontaneous environments (i18n extension and Template)
323 # - unittests
324 # If parameter changes are required only add parameters at the end
325 # and don't change the arguments (or the defaults!) of the arguments
326 # existing already.
327
328 # lexer / parser information
329 self.block_start_string = block_start_string
330 self.block_end_string = block_end_string
331 self.variable_start_string = variable_start_string
332 self.variable_end_string = variable_end_string
333 self.comment_start_string = comment_start_string
334 self.comment_end_string = comment_end_string
335 self.line_statement_prefix = line_statement_prefix
336 self.line_comment_prefix = line_comment_prefix
337 self.trim_blocks = trim_blocks
338 self.lstrip_blocks = lstrip_blocks
339 self.newline_sequence = newline_sequence
340 self.keep_trailing_newline = keep_trailing_newline
341
342 # runtime information
343 self.undefined: t.Type[Undefined] = undefined
344 self.optimized = optimized
345 self.finalize = finalize
346 self.autoescape = autoescape
347
348 # defaults
349 self.filters = DEFAULT_FILTERS.copy()

Callers

nothing calls this directly

Calls 4

create_cacheFunction · 0.70
load_extensionsFunction · 0.70
copyMethod · 0.65

Tested by

no test coverage detected