Skip to content

Commit

Permalink
Migrate from conventional Python f-strings to Jinja2
Browse files Browse the repository at this point in the history
  • Loading branch information
srevinsaju committed Sep 13, 2020
1 parent 7626f11 commit 80e63c1
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions aslo4/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,15 @@ def generate_web_page(
# information
debug("[STATIC][{}] Generating static HTML".format(
bundle.get_name()))
parsed_html = HTML_TEMPLATE.format(
output_html_file_name_path = os.path.join(output_dir, 'app',
'{}.html'.format(bundle.get_bundle_id()))
# write the html file to specified path
debug("[STATIC][{}] Writing static HTML".format(bundle.get_name()))
read_parse_and_write_template(
file_system_loader=self.file_system_loader,
html_template_path=os.path.join(args.pull_static_css_js_html,
'templates', 'app.html'),
html_output_path=output_html_file_name_path,
title=bundle.get_name(),
version=bundle.get_version(),
summary=bundle.get_summary(),
Expand Down Expand Up @@ -756,15 +764,6 @@ def generate_web_page(
)
parsed_rdf = rdf.parse()

# write the html file to specified path
debug("[STATIC][{}] Writing static HTML".format(bundle.get_name()))
with open(os.path.join(
output_dir,
'app',
'{}.html'.format(bundle.get_bundle_id())
), 'w') as w:
w.write(parsed_html)

debug("[STATIC][{}] Writing RDF".format(bundle.get_name()))
with open(os.path.join(
output_dir, 'api',
Expand Down

0 comments on commit 80e63c1

Please sign in to comment.