minor fix

This commit is contained in:
ppwwyyxx
2014-12-22 16:53:23 +08:00
parent f7b66958e8
commit db3434d539
4 changed files with 19 additions and 20 deletions
+4 -5
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: render.py
# Date: Mon Dec 22 09:49:12 2014 +0800
# Date: Mon Dec 22 16:52:48 2014 +0800
# Author: Yuxin Wu <[email protected]>
import os
@@ -27,9 +27,8 @@ TEMPLATES_FILES = {TYPE_MSG: "TP_MSG",
TYPE_SPEAK: "TP_SPEAK",
TYPE_EMOJI: "TP_EMOJI",
TYPE_LINK: "TP_MSG"}
TEMPLATES = dict([(k, ensure_unicode(open(os.path.join(
LIB_PATH, 'static/{}.html'.format(v))).read()))
for k, v in TEMPLATES_FILES.iteritems()])
TEMPLATES = {k: ensure_unicode(open(os.path.join(LIB_PATH, 'static/{}.html'.format(v))).read())
for k, v in TEMPLATES_FILES.iteritems()}
class HTMLRender(object):
def __init__(self, parser, res=None):
@@ -108,7 +107,7 @@ class HTMLRender(object):
else:
group = None
emoji_img, format = self.res.get_emoji(imgpath, group)
assert emoji_img
#assert emoji_img
return template.format(sender_label=sender,
emoji_format=format,
emoji_img=emoji_img)