Write template-output as utf-8
This commit is contained in:
parent
c0096a7c52
commit
7cd057d3c5
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from codecs import open
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ def render_template(clients, output, title='TeamspeakStats',
|
||||||
template_env.filters['frmttime'] = frmttime
|
template_env.filters['frmttime'] = frmttime
|
||||||
template = template_env.get_template(template_path)
|
template = template_env.get_template(template_path)
|
||||||
logger.debug('Rendering template %s', template)
|
logger.debug('Rendering template %s', template)
|
||||||
with open(output, 'w') as f:
|
with open(output, 'w', encoding='utf-8') as f:
|
||||||
f.write(template.render(title=title, objs=objs,
|
f.write(template.render(title=title, objs=objs,
|
||||||
debug=logger.level <= logging.DEBUG,
|
debug=logger.level <= logging.DEBUG,
|
||||||
creation_time=datetime.now()))
|
creation_time=datetime.now()))
|
||||||
|
|
Loading…
Reference in New Issue