Skip to content

Commit

Permalink
Add fs_loader_path to the example generator plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Apr 3, 2023
1 parent 7da2846 commit 73107a7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions scripts/py_matter_idl/examples/matter_idl_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 73107a7

Please sign in to comment.