summaryrefslogtreecommitdiff
path: root/jtlib/plugins/new_topic_plugin.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-10-03 12:41:21 +0300
committerLars Wirzenius <liw@liw.fi>2015-10-03 13:08:17 +0300
commitd8b539a9f2a18369400444ada72dff4a83595bab (patch)
tree56d920df78424dd5ed486dd2bc5a240cfa0a39d0 /jtlib/plugins/new_topic_plugin.py
parent7cb2a4b266c1d140ebd3c9198ca5754acda576ae (diff)
downloadjt-d8b539a9f2a18369400444ada72dff4a83595bab.tar.gz
Use jinja2 for templates
Diffstat (limited to 'jtlib/plugins/new_topic_plugin.py')
-rw-r--r--jtlib/plugins/new_topic_plugin.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/jtlib/plugins/new_topic_plugin.py b/jtlib/plugins/new_topic_plugin.py
index 4f44f2b..1114bb4 100644
--- a/jtlib/plugins/new_topic_plugin.py
+++ b/jtlib/plugins/new_topic_plugin.py
@@ -49,6 +49,9 @@ class NewTopicCommand(cliapp.Plugin):
if not os.path.exists(dirname):
os.makedirs(dirname)
- template = self.app.read_template('new_topic.tmpl')
+ vars = {
+ 'title': title,
+ }
+ rendered_template = self.app.render_template('new_topic.j2', vars)
with open(pathname, 'w') as f:
- f.write(template % {'title': title})
+ f.write(rendered_template)