修复路径问题

This commit is contained in:
shuaikangzhou 2024-02-09 18:00:06 +08:00
parent 87a48c5955
commit 75cc118d99
6 changed files with 48 additions and 18 deletions

View File

@ -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
]
}

View File

@ -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
]
}

View File

@ -19,8 +19,10 @@ from app.DataBase import misc_db, micro_msg_db, close_db
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

View File

@ -239,7 +239,7 @@ class DocxExporter(ExporterBase):
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])
@ -255,7 +255,7 @@ class DocxExporter(ExporterBase):
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]
@ -282,7 +282,7 @@ class DocxExporter(ExporterBase):
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"

View File

@ -63,7 +63,7 @@ class HtmlExporter(ExporterBase):
)
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]
@ -99,7 +99,7 @@ class HtmlExporter(ExporterBase):
)
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]
@ -170,7 +170,7 @@ class HtmlExporter(ExporterBase):
)
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]
@ -211,7 +211,7 @@ class HtmlExporter(ExporterBase):
)
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])
@ -232,7 +232,7 @@ class HtmlExporter(ExporterBase):
)
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]
@ -379,7 +379,7 @@ class OutputMedia(QThread):
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]
@ -408,7 +408,7 @@ class OutputEmoji(QThread):
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]
@ -445,7 +445,7 @@ class OutputImage(QThread):
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:
@ -487,7 +487,7 @@ class OutputImageChild(QThread):
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]

View File

@ -81,7 +81,7 @@ class Output(QThread):
@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(*.*)")
@ -337,7 +337,7 @@ class OutputEmoji(QThread):
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]
@ -374,7 +374,7 @@ class OutputImage(QThread):
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:
@ -406,7 +406,7 @@ class OutputImageChild(QThread):
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]