From 73107a7a738af6d3af1b583387c6360986b3dce2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 3 Apr 2023 12:04:34 -0400 Subject: [PATCH] Add fs_loader_path to the example generator plugin. --- .../examples/matter_idl_plugin/__init__.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py b/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py index c1783f8651d592..502c4ed187b85f 100644 --- a/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py +++ b/scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py @@ -199,13 +199,7 @@ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs): Inintialization is specific for java generation and will add filters as required by the java .jinja templates to function. """ - super().__init__(storage, idl) - - # Override the template path to use local templates within this plugin directory - self.jinja_env = jinja2.Environment( - loader=jinja2.FileSystemLoader( - searchpath=os.path.dirname(__file__)), - keep_trailing_newline=True) + super().__init__(storage, idl, fs_loader_searchpath=os.path.dirname(__file__)) # String helpers self.jinja_env.filters['toLowerSnakeCase'] = toLowerSnakeCase @@ -241,7 +235,7 @@ def internal_render_all(self): # Header containing a macro to initialize all cluster plugins self.internal_render_one_output( - template_path="./matter_cluster_proto.jinja", + template_path="matter_cluster_proto.jinja", output_file_name=filename, vars={ 'cluster': cluster,