fix missing file

This commit is contained in:
ppwwyyxx
2014-12-21 21:23:44 +08:00
parent 1a5ae2b1f2
commit 41982c3f2d
4 changed files with 24 additions and 4 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: msg.py
# Date: Sat Dec 20 18:38:59 2014 +0800
# Date: Sun Dec 21 21:23:27 2014 +0800
# Author: Yuxin Wu <[email protected]>
from datetime import datetime
@@ -61,6 +61,7 @@ class WeChatMsg(object):
url = soup.find('url').text
if not url:
title = soup.find('title').text
# TODO sometimes fail to parse title
if not title:
print self.content
from IPython import embed; embed()
+4 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: render.py
# Date: Sat Dec 20 20:15:47 2014 +0800
# Date: Sun Dec 21 21:21:53 2014 +0800
# Author: Yuxin Wu <[email protected]>
import os
@@ -90,7 +90,9 @@ class HTMLRender(object):
bigimgpath = self.parser.imginfo.get(msg.msgSvrId)
fnames = [k for k in [imgpath, bigimgpath] if k is not None]
bigimg, smallimg = self.res.get_img(fnames)
assert smallimg
if not smallimg:
logger.warn("No image thumbnail found for {}".format(imgpath))
return fallback()
# TODO do not show fancybox when no bigimg found
return template.format(sender_label=sender,
small_img=smallimg,
+2 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: res.py
# Date: Sat Dec 20 20:14:40 2014 +0800
# Date: Sun Dec 21 21:22:44 2014 +0800
# Author: Yuxin Wu <[email protected]>
import glob
@@ -155,6 +155,7 @@ class Resource(object):
if len(candidates) > 1:
# annimation
candidates = [k for k in candidates if not re.match('.*_[0-9]+$', k)]
# only one file is the gif in need, others are frames and cover
assert len(candidates) == 1
fname = candidates[0]
return Resource.get_file_b64(fname), imghdr.what(fname)
+16
View File
@@ -0,0 +1,16 @@
<div class="chatItem {sender_label}">
<div class="chatItemContent">
<img class="avatar" src="">
<div class="cloud cloudImg">
<div class="cloudPannel">
<div class="cloudBody">
<div class="cloudContent">
<span class="img_wrap">
<img class="zoomIn imageBorder" src="data:image/{emoji_format};base64,{emoji_img}"/>
</span>
</div>
</div>
</div>
</div>
</div>
</div>