Skip to content

Commit

Permalink
Replace todo variable name in scripts/generate_tmpl.py (annoying wh…
Browse files Browse the repository at this point in the history
…en grep TODO)
  • Loading branch information
touilleMan committed Oct 22, 2023
1 parent 2f264d4 commit 8f6c1b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/generate_tmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def make_jinja_env(import_dir: Path) -> Environment:

args = parser.parse_args()

todo: List[Tuple[Path, str, Path]] = []
items: List[Tuple[Path, str, Path]] = []
need_classes = False
for output in args.output:
# We use # in the name to simulate folder hierarchy in the meson build
Expand All @@ -154,7 +154,7 @@ def make_jinja_env(import_dir: Path) -> Environment:
raise SystemExit(f"Unknown output, valid values: {', '.join(TARGETS.keys())}")
need_classes |= template_need_classes
template_name = f"{name}.j2"
todo.append((output, template_name, template_home))
items.append((output, template_name, template_home))

if need_classes:
if args.classes_sample:
Expand All @@ -168,8 +168,8 @@ def make_jinja_env(import_dir: Path) -> Environment:
path=args.input, build_config=BuildConfig(args.build_config), filter_classes=filter_classes
)

for todo_output, todo_template_name, todo_template_home in todo:
env = make_jinja_env(todo_template_home)
template = env.get_template(todo_template_name)
for item_output, item_template_name, item_template_home in items:
env = make_jinja_env(item_template_home)
template = env.get_template(item_template_name)
code = template.render(api=api)
todo_output.write_text(code, encoding="utf8")
item_output.write_text(code, encoding="utf8")

0 comments on commit 8f6c1b1

Please sign in to comment.