Skip to content

Commit

Permalink
feat(devtools): separate get_template in preparation for multiple tem…
Browse files Browse the repository at this point in the history
…plates
  • Loading branch information
szabgab committed Jan 15, 2022
1 parent ab2c8bb commit a6955bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/tools/librelingo_tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ def get_args():
return args


def generate_html(start_time, end_time, links, outdir):
def get_template(filename):
root = os.path.dirname(os.path.abspath(__file__))
templates_dir = os.path.join(root, "templates")
env = Environment(loader=FileSystemLoader(templates_dir), autoescape=True)
template = env.get_template("courses.html")
return env.get_template(filename)


def generate_html(start_time, end_time, links, outdir):
template = get_template("courses.html")
html = template.render(
start_time=start_time,
end_time=end_time,
Expand Down

1 comment on commit a6955bf

@vercel
Copy link

@vercel vercel bot commented on a6955bf Jan 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.