aboutsummaryrefslogtreecommitdiffstats
path: root/generate_html_cs.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2019-12-26 11:52:22 +0100
committerMatěj Cepl <mcepl@cepl.eu>2019-12-26 11:52:22 +0100
commitf39248d46bc064ed63d862b48168441013213858 (patch)
tree0ec3a6023b379a162f7616ca74d45fdcbb4ab487 /generate_html_cs.py
parentcbbdeda4c31df80353e201f5405694ddbb1a1421 (diff)
downloadhesla-f39248d46bc064ed63d862b48168441013213858.tar.gz
Some improvements to make the scripts generate proper HTML pages again.
Diffstat (limited to 'generate_html_cs.py')
-rwxr-xr-xgenerate_html_cs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/generate_html_cs.py b/generate_html_cs.py
index 9301ca2..55c4c43 100755
--- a/generate_html_cs.py
+++ b/generate_html_cs.py
@@ -115,7 +115,7 @@ def parse_body(elem):
raise
# text of the verse
- wword['text'] = parse_verses(list(elem.getiterator("L")))
+ wword['text'] = parse_verses(list(elem.iter("L")))
# references
ref = elem.find("SL")
@@ -215,18 +215,18 @@ def parse_file(filename):
env = jinja2.Environment(loader=jinja2.FileSystemLoader('templates'))
template = env.get_template('czech.html')
- for los in tree.getiterator("LOSUNG"):
+ for los in tree.iter("LOSUNG"):
key, text = parse_losung(los)
article_dict[key] = text
- for los in tree.getiterator("DAY"):
+ for los in tree.iter("DAY"):
parse_day(los, article_dict)
article_list = []
article_keys = sorted(article_dict.keys())
for key in article_keys:
article_list.append(article_dict[key])
- return template.render(articles=article_list).encode('utf8')
+ return template.render(articles=article_list)
if __name__ == "__main__":