diff options
author | jantwisted <janith@member.fsf.org> | 2015-12-16 01:51:13 +0530 |
---|---|---|
committer | jantwisted <janith@member.fsf.org> | 2015-12-16 01:51:13 +0530 |
commit | 9a9052e5bd06dd3ecafe263f9f5546435f12e616 (patch) | |
tree | 5475f31820eada1be08219003411e571892a8c19 /lps_gen.py | |
parent | 01997af8b0c04318c2c76afc29eb043052e3d793 (diff) |
comment added
Diffstat (limited to 'lps_gen.py')
-rw-r--r-- | lps_gen.py | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -133,15 +133,18 @@ class LPSMarkdown(Markdown): html = super(LPSMarkdown, self).parse(text) return lps_dict -def HTMLRender(_dict): - - templateLoader = jinja2.FileSystemLoader( searchpath="./" ) - templateEnv = jinja2.Environment( loader=templateLoader ) - TEMPLATE_FILE = "tests/files/index.html" - template = templateEnv.get_template( TEMPLATE_FILE ) - _data = {'res':_dict} - outputText = template.render( _data ) - return outputText +def HTMLRender(_dict): + """Render html from a dictionary and returns a string. + + Uses jinja2 and HTML template file. + """ + templateLoader = jinja2.FileSystemLoader( searchpath="./" ) + templateEnv = jinja2.Environment( loader=templateLoader ) + TEMPLATE_FILE = "tests/files/index.html" + template = templateEnv.get_template( TEMPLATE_FILE ) + _data = {'res':_dict} + lps_output = template.render( _data ) + return lps_output def main(): parser = ArgumentParser() |