diff --git a/dump-html.py b/dump-html.py index 0ba8a3e..6234ca9 100755 --- a/dump-html.py +++ b/dump-html.py @@ -5,9 +5,9 @@ import sys import argparse import logging -from common.textutil import ensure_unicode from wechat.parser import WeChatDBParser from wechat.res import Resource +from wechat.common.textutil import ensure_unicode from wechat.render import HTMLRender logger = logging.getLogger("wechat") diff --git a/dump-msg.py b/dump-msg.py index dd6fd33..61c5c7a 100755 --- a/dump-msg.py +++ b/dump-msg.py @@ -3,7 +3,7 @@ import logging from wechat.parser import WeChatDBParser -from common.textutil import safe_filename +from wechat.common.textutil import safe_filename import sys, os logger = logging.getLogger("wechat") diff --git a/legacy/libchathelper.py b/legacy/libchathelper.py index 96a6e59..32bfb69 100644 --- a/legacy/libchathelper.py +++ b/legacy/libchathelper.py @@ -8,8 +8,8 @@ logger = logging.getLogger(__name__) from libchat.libchat import SqliteLibChat, ChatMsg from .msg import * -from common.timer import timing -from common.progress import ProgressReporter +from .common.timer import timing +from .common.progress import ProgressReporter class LibChatHelper(object): """ Build LibChat messages from WeChat Msg""" diff --git a/plot-num-msg-by-time.py b/plot-num-msg-by-time.py index df6591b..7e1b3df 100755 --- a/plot-num-msg-by-time.py +++ b/plot-num-msg-by-time.py @@ -5,7 +5,7 @@ # Author: Yuxin Wu from wechat.parser import WeChatDBParser -from common.textutil import ensure_unicode +from wechat.common.textutil import ensure_unicode from datetime import timedelta, datetime import numpy as np diff --git a/wechat/audio.py b/wechat/audio.py index 6892a06..12cc038 100644 --- a/wechat/audio.py +++ b/wechat/audio.py @@ -5,8 +5,8 @@ import os import logging logger = logging.getLogger(__name__) -from common.textutil import get_file_b64 -from common.procutil import subproc_succ +from .common.textutil import get_file_b64 +from .common.procutil import subproc_succ SILK_DECODER = os.path.join(os.path.dirname(__file__), '../third-party/silk/decoder') diff --git a/wechat/avatar.py b/wechat/avatar.py index 0b04043..6bd7779 100644 --- a/wechat/avatar.py +++ b/wechat/avatar.py @@ -10,7 +10,7 @@ import logging import sqlite3 logger = logging.getLogger(__name__) -from common.textutil import ensure_unicode, md5 +from .common.textutil import ensure_unicode, md5 class AvatarReader(object): diff --git a/common/__init__.py b/wechat/common/__init__.py similarity index 100% rename from common/__init__.py rename to wechat/common/__init__.py diff --git a/common/procutil.py b/wechat/common/procutil.py similarity index 100% rename from common/procutil.py rename to wechat/common/procutil.py diff --git a/common/progress.py b/wechat/common/progress.py similarity index 100% rename from common/progress.py rename to wechat/common/progress.py diff --git a/common/textutil.py b/wechat/common/textutil.py similarity index 100% rename from common/textutil.py rename to wechat/common/textutil.py diff --git a/common/timer.py b/wechat/common/timer.py similarity index 100% rename from common/timer.py rename to wechat/common/timer.py diff --git a/wechat/msg.py b/wechat/msg.py index 66273f5..e6cfbdc 100644 --- a/wechat/msg.py +++ b/wechat/msg.py @@ -25,7 +25,7 @@ import xml.etree.ElementTree as ET import logging logger = logging.getLogger(__name__) -from common.textutil import ensure_unicode +from .common.textutil import ensure_unicode class WeChatMsg(object): diff --git a/wechat/parser.py b/wechat/parser.py index a97a344..2aa6d1e 100644 --- a/wechat/parser.py +++ b/wechat/parser.py @@ -8,7 +8,7 @@ import logging logger = logging.getLogger(__name__) from .msg import WeChatMsg, TYPE_SYSTEM -from common.textutil import ensure_unicode +from .common.textutil import ensure_unicode """ tables in concern: emojiinfo diff --git a/wechat/render.py b/wechat/render.py index 6d59732..6f73a78 100644 --- a/wechat/render.py +++ b/wechat/render.py @@ -20,9 +20,9 @@ except ImportError: css_compress = lambda x: x from .msg import * -from common.textutil import ensure_unicode, get_file_b64 -from common.progress import ProgressReporter -from common.timer import timing +from .common.textutil import ensure_unicode, get_file_b64 +from .common.progress import ProgressReporter +from .common.timer import timing from .smiley import SmileyProvider from .msgslice import MessageSlicerByTime, MessageSlicerBySize diff --git a/wechat/res.py b/wechat/res.py index 46f9d80..e23a9d3 100644 --- a/wechat/res.py +++ b/wechat/res.py @@ -15,8 +15,8 @@ import pickle import requests from .avatar import AvatarReader -from common.textutil import md5, get_file_b64 -from common.timer import timing +from .common.textutil import md5, get_file_b64 +from .common.timer import timing from .msg import TYPE_SPEAK from .audio import parse_wechat_audio_file diff --git a/wechat/smiley.py b/wechat/smiley.py index 5475082..ec68bc6 100755 --- a/wechat/smiley.py +++ b/wechat/smiley.py @@ -7,7 +7,7 @@ import re import json import struct -from common.textutil import get_file_b64 +from .common.textutil import get_file_b64 STATIC_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static') TENCENT_SMILEY_FILE = os.path.join(STATIC_PATH, 'tencent-smiley.json')