Skip to content

Commit

Permalink
Merge pull request #314
Browse files Browse the repository at this point in the history
🎂 前端更新:重建HTML文件导出模板
  • Loading branch information
LC044 authored Jan 16, 2024
2 parents f5ca91c + aa6ee88 commit 14590c0
Show file tree
Hide file tree
Showing 6 changed files with 1,417 additions and 909 deletions.
10 changes: 5 additions & 5 deletions app/DataBase/exporter_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
from app.util.image import get_image_path, get_image
from app.util.music import get_music_path


icon_files = {
'./icon/word.png': ['doc', 'docx'],
'./icon/excel.png': ['xls', 'xlsx'],
'./icon/csv.png': ['csv'],
'./icon/txt.png': ['txt'],
'./icon/zip.png': ['zip', '7z','rar'],
'./icon/zip.png': ['zip', '7z', 'rar'],
'./icon/ppt.png': ['ppt', 'pptx'],
'./icon/pdf.png': ['pdf'],
}



class HtmlExporter(ExporterBase):
def text(self, doc, message):
type_ = message[2]
Expand Down Expand Up @@ -287,7 +285,9 @@ def export(self):
content = f.read()
html_head, html_end = content.split('/*注意看这是分割线*/')
f = open(filename, 'w', encoding='utf-8')
f.write(html_head.replace("<title>Chat Records</title>", f"<title>{self.contact.remark}</title>"))
html_head = html_head.replace("<title>出错了</title>", f"<title>{self.contact.remark}</title>")
html_head = html_head.replace("<p id=\"title\">出错了</p>", f"<p id=\"title\">{self.contact.remark}</p>")
f.write(html_head)
self.rangeSignal.emit(len(messages))
for index, message in enumerate(messages):
type_ = message[2]
Expand Down Expand Up @@ -333,7 +333,7 @@ def count_finish_num(self, num):
@return:
"""
self.num += 1
print('子线程完成',self.num,'/',self.total_num)
print('子线程完成', self.num, '/', self.total_num)
if self.num == self.total_num:
# 所有子线程都完成之后就发送完成信号
self.okSignal.emit(1)
Expand Down
Loading

0 comments on commit 14590c0

Please sign in to comment.