From 120a47009c2a0a3744ce76ca889cc7286b5cfc5d Mon Sep 17 00:00:00 2001 From: shuaikangzhou <863909694@qq.com> Date: Fri, 26 Jan 2024 21:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=BD=AC=E8=B4=A6=EF=BC=8C?= =?UTF-8?q?=E9=9F=B3=E8=A7=86=E9=A2=91=E9=80=9A=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/exporter_html.py | 11 +++++++---- app/ui/contact/export/export_dialog.py | 2 +- app/ui/menu/export.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/DataBase/exporter_html.py b/app/DataBase/exporter_html.py index d5d7fbf..4a75538 100644 --- a/app/DataBase/exporter_html.py +++ b/app/DataBase/exporter_html.py @@ -203,7 +203,7 @@ class HtmlExporter(ExporterBase): if video_path is None and image_path is None: return video_path = f'{Me().wx_dir}/{video_path}' - video_path = video_path.replace('\\','/') + video_path = video_path.replace('\\', '/') if os.path.exists(video_path): new_path = origin_docx_path + '/video/' + os.path.basename(video_path) if not os.path.exists(new_path): @@ -269,7 +269,7 @@ class HtmlExporter(ExporterBase): is_send = message[4] timestamp = message[5] compress_content_ = message[11] - open("test.bin", "wb").write(compress_content_) + # open("test.bin", "wb").write(compress_content_) transfer_detail = transfer_decompress(compress_content_) is_chatroom = 1 if self.contact.is_chatroom else 0 avatar = self.get_avatar_path(is_send, message) @@ -278,8 +278,10 @@ class HtmlExporter(ExporterBase): 1: transfer_detail["pay_memo"] or "转账", 3: "已收款", 4: "已退还", + 7: "未知", } - doc.write(f"""{{ type:49, sub_type:2000,text:'{text_info_map[transfer_detail["paysubtype"]]}',is_send:{is_send},avatar_path:'{avatar}',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}',paysubtype:{transfer_detail["paysubtype"]},pay_memo:'{transfer_detail["pay_memo"]}',feedesc:'{transfer_detail["feedesc"]}',}},\n""") + doc.write( + f"""{{ type:49, sub_type:2000,text:'{text_info_map[transfer_detail["paysubtype"]]}',is_send:{is_send},avatar_path:'{avatar}',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}',paysubtype:{transfer_detail["paysubtype"]},pay_memo:'{transfer_detail["pay_memo"]}',feedesc:'{transfer_detail["feedesc"]}',}},\n""") def call(self, doc, message): is_send = message[4] @@ -293,7 +295,8 @@ class HtmlExporter(ExporterBase): is_chatroom = 1 if self.contact.is_chatroom else 0 avatar = self.get_avatar_path(is_send, message) display_name = self.get_display_name(is_send, message) - doc.write(f"""{{ type:50, text:'{call_detail["display_content"]}',call_type:{call_detail["call_type"]},avatar_path:'{avatar}',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}',}},\n""") + doc.write( + f"""{{ type:50, text:'{call_detail["display_content"]}',call_type:{call_detail["call_type"]},avatar_path:'{avatar}',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}',}},\n""") def export(self): print(f"【开始导出 HTML {self.contact.remark}】") diff --git a/app/ui/contact/export/export_dialog.py b/app/ui/contact/export/export_dialog.py index 02abead..caf828d 100644 --- a/app/ui/contact/export/export_dialog.py +++ b/app/ui/contact/export/export_dialog.py @@ -49,7 +49,7 @@ class ExportDialog(QDialog, Ui_Dialog): if file_type == 'html': self.export_type = Output.HTML self.export_choices = {"文本": True, "图片": True, "语音": False, "视频": False, "表情包": False, - '音乐与音频': False, '分享卡片': False, '文件': False, '音视频通话': False, + '音乐与音频': False, '分享卡片': False, '文件': False, '拍一拍等系统消息': True} # 定义导出的数据类型,默认全部选择 elif file_type == 'csv': self.export_type = Output.CSV diff --git a/app/ui/menu/export.py b/app/ui/menu/export.py index cbfa851..d8db9d3 100644 --- a/app/ui/menu/export.py +++ b/app/ui/menu/export.py @@ -65,7 +65,7 @@ class ExportDialog(QDialog, Ui_Dialog): self.textBrowser.setVerticalScrollBar(scroll_bar) self.export_choices = {"文本": True, "图片": True, "语音": False, "视频": False, "表情包": False, '音乐与音频': False, '分享卡片': False, '文件': False, - '转账': False, '音视频通话': False, '拍一拍等系统消息': True} # 定义导出的数据类型 + '拍一拍等系统消息': True} # 定义导出的数据类型 self.setWindowTitle(title) self.checkBox_word.setEnabled(False) self.checkBox_word.setText('Docx(暂时不可用)')