some small fix..

This commit is contained in:
ppwwyyxx
2015-05-25 15:17:17 +08:00
parent 5d0acef6db
commit 538a2e0f66
4 changed files with 11 additions and 5 deletions
+3 -2
View File
@@ -1,10 +1,11 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: dump_msg.py
# Date: Wed Mar 25 17:44:34 2015 +0800
# Date: Mon May 25 15:16:31 2015 +0800
# Author: Yuxin Wu <[email protected]>
from wechat.parser import WeChatDBParser
from wechat.utils import safe_filename
import sys, os
if len(sys.argv) != 3:
@@ -23,6 +24,6 @@ parser = WeChatDBParser(db_file)
for name, msgs in parser.msgs_by_talker.iteritems():
print u"Writing msgs for {}".format(name)
with open(os.path.join(output_dir, name + '.txt'), 'w') as f:
with open(os.path.join(output_dir, safe_filename(name) + '.txt'), 'w') as f:
for m in msgs:
print >> f, m