Skip to content

Commit

Permalink
修复路径问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Feb 9, 2024
1 parent 87a48c5 commit 75cc118
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 18 deletions.
14 changes: 14 additions & 0 deletions app/decrypt/version_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,5 +586,19 @@
39016312,
0,
0
],
"3.0.0.0": [
25834908,
25846332,
25834960,
0,
0
],
"3.7.0.23": [
37105844,
37106952,
37105896,
0,
0
]
}
14 changes: 14 additions & 0 deletions app/resources/data/version_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,5 +586,19 @@
39016312,
0,
0
],
"3.0.0.0": [
25834908,
25846332,
25834960,
0,
0
],
"3.7.0.23": [
37105844,
37106952,
37105896,
0,
0
]
}
6 changes: 4 additions & 2 deletions app/ui/mainview.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
from app.ui.Icon import Icon
from . import mainwindow
# 不能删,删了会出错
from .chat import ChatWindow
from .contact import ContactWindow
from app.ui.chat import ChatWindow
from app.ui.contact import ContactWindow
from app.ui.tool.tool_window import ToolWindow
from app.ui.home.home_window import HomeWindow
from .menu.export import ExportDialog
from app.util.exporter.output import Output
from ..components.QCursorGif import QCursorGif
Expand Down
6 changes: 3 additions & 3 deletions app/util/exporter/exporter_docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def create_table(self, doc, is_send, avatar_path):
return content_cell

def music_share(self, doc, message):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
is_send = message[4]
timestamp = message[5]
content = music_share(message[11])
Expand All @@ -255,7 +255,7 @@ def music_share(self, doc, message):
display_name = self.get_display_name(is_send, message)

def share_card(self, doc, message):
origin_path = f"{os.path.abspath('../../DataBase')}/data/聊天记录/{self.contact.remark}"
origin_path = f"{os.getcwd()}/data/聊天记录/{self.contact.remark}"
is_send = message[4]
timestamp = message[5]
bytesExtra = message[10]
Expand All @@ -282,7 +282,7 @@ def share_card(self, doc, message):
app_logo = ''

def merge_docx(self, conRemark, n):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录')
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录')
all_file_path = []
for i in range(n):
file_name = f"{conRemark}{i}.docx"
Expand Down
18 changes: 9 additions & 9 deletions app/util/exporter/exporter_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def image(self, doc, message):
)

def audio(self, doc, message):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
str_content = message[7]
str_time = message[8]
is_send = message[4]
Expand Down Expand Up @@ -99,7 +99,7 @@ def emoji(self, doc, message):
)

def file(self, doc, message):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
bytesExtra = message[10]
compress_content = message[11]
str_time = message[8]
Expand Down Expand Up @@ -170,7 +170,7 @@ def system_msg(self, doc, message):
)

def video(self, doc, message):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
type_ = message[2]
str_content = message[7]
str_time = message[8]
Expand Down Expand Up @@ -211,7 +211,7 @@ def video(self, doc, message):
)

def music_share(self, doc, message):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
is_send = message[4]
timestamp = message[5]
content = music_share(message[11])
Expand All @@ -232,7 +232,7 @@ def music_share(self, doc, message):
)

def share_card(self, doc, message):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
is_send = message[4]
timestamp = message[5]
bytesExtra = message[10]
Expand Down Expand Up @@ -379,7 +379,7 @@ def __init__(self, contact):
self.contact = contact

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
messages = msg_db.get_messages_by_type(self.contact.wxid, 34)
for message in messages:
is_send = message[4]
Expand Down Expand Up @@ -408,7 +408,7 @@ def __init__(self, contact):
self.contact = contact

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
messages = msg_db.get_messages_by_type(self.contact.wxid, 47)
for message in messages:
str_content = message[7]
Expand Down Expand Up @@ -445,7 +445,7 @@ def count1(self, num):
print("图片导出完成")

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
messages = msg_db.get_messages_by_type(self.contact.wxid, 3)
base_path = os.path.join(output_dir, '聊天记录', self.contact.remark, 'image')
for message in messages:
Expand Down Expand Up @@ -487,7 +487,7 @@ def __init__(self, contact, messages):
self.messages = messages

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
for message in self.messages:
str_content = message[7]
BytesExtra = message[10]
Expand Down
8 changes: 4 additions & 4 deletions app/util/exporter/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def to_csv_all(self):
@return:
"""

origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录')
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录')
os.makedirs(origin_path, exist_ok=True)
filename = QFileDialog.getSaveFileName(None, "save file", os.path.join(os.getcwd(), 'messages.csv'),
"csv files (*.csv);;all files(*.*)")
Expand Down Expand Up @@ -337,7 +337,7 @@ def __init__(self, contact, time_range=None):
self.time_range = time_range

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
messages = msg_db.get_messages_by_type(self.contact.wxid, 47, time_range=self.time_range)
for message in messages:
str_content = message[7]
Expand Down Expand Up @@ -374,7 +374,7 @@ def count1(self, num):
print('图片导出完成')

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
messages = msg_db.get_messages_by_type(self.contact.wxid, 3, time_range=self.time_range)
base_path = os.path.join(output_dir,'聊天记录',self.contact.remark,'image')
for message in messages:
Expand Down Expand Up @@ -406,7 +406,7 @@ def __init__(self, contact, messages, time_range):
self.time_range = time_range

def run(self):
origin_path = os.path.join(os.path.abspath('../../DataBase'), output_dir, '聊天记录', self.contact.remark)
origin_path = os.path.join(os.getcwd(), output_dir, '聊天记录', self.contact.remark)
for message in self.messages:
str_content = message[7]
BytesExtra = message[10]
Expand Down

0 comments on commit 75cc118

Please sign in to comment.