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

Function initialize_jinja_env

deps/inspector_protocol/code_generator.py:197–215  ·  view source on GitHub ↗
(jinja_dir, cache_dir, config)

Source from the content-addressed store, hash-verified

195
196
197def initialize_jinja_env(jinja_dir, cache_dir, config):
198 # pylint: disable=F0401
199 sys.path.insert(1, os.path.abspath(jinja_dir))
200 import jinja2
201
202 jinja_env = jinja2.Environment(
203 loader=jinja2.FileSystemLoader(module_path),
204 # Bytecode cache is not concurrency-safe unless pre-cached:
205 # if pre-cached this is read-only, but writing creates a race condition.
206 bytecode_cache=jinja2.FileSystemBytecodeCache(cache_dir),
207 keep_trailing_newline=True, # newline-terminate generated files
208 lstrip_blocks=True, # so can indent control flow tags
209 trim_blocks=True)
210 jinja_env.filters.update({
211 "to_title_case": to_title_case,
212 "dash_to_camelcase": dash_to_camelcase,
213 "to_method_case": functools.partial(to_method_case, config)})
214 jinja_env.add_extension("jinja2.ext.loopcontrols")
215 return jinja_env
216
217
218def create_imported_type_definition(domain_name, type, imported_namespace):

Callers 1

mainFunction · 0.70

Calls 4

add_extensionMethod · 0.95
partialMethod · 0.80
updateMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…