mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 10:52:18 +08:00
🎂 前端更新:重建HTML文件导出模板
This commit is contained in:
parent
f5ca91cc31
commit
aa6ee88d7b
@ -16,19 +16,17 @@ from app.util.emoji import get_emoji_url
|
|||||||
from app.util.image import get_image_path, get_image
|
from app.util.image import get_image_path, get_image
|
||||||
from app.util.music import get_music_path
|
from app.util.music import get_music_path
|
||||||
|
|
||||||
|
|
||||||
icon_files = {
|
icon_files = {
|
||||||
'./icon/word.png': ['doc', 'docx'],
|
'./icon/word.png': ['doc', 'docx'],
|
||||||
'./icon/excel.png': ['xls', 'xlsx'],
|
'./icon/excel.png': ['xls', 'xlsx'],
|
||||||
'./icon/csv.png': ['csv'],
|
'./icon/csv.png': ['csv'],
|
||||||
'./icon/txt.png': ['txt'],
|
'./icon/txt.png': ['txt'],
|
||||||
'./icon/zip.png': ['zip', '7z','rar'],
|
'./icon/zip.png': ['zip', '7z', 'rar'],
|
||||||
'./icon/ppt.png': ['ppt', 'pptx'],
|
'./icon/ppt.png': ['ppt', 'pptx'],
|
||||||
'./icon/pdf.png': ['pdf'],
|
'./icon/pdf.png': ['pdf'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HtmlExporter(ExporterBase):
|
class HtmlExporter(ExporterBase):
|
||||||
def text(self, doc, message):
|
def text(self, doc, message):
|
||||||
type_ = message[2]
|
type_ = message[2]
|
||||||
@ -287,7 +285,9 @@ class HtmlExporter(ExporterBase):
|
|||||||
content = f.read()
|
content = f.read()
|
||||||
html_head, html_end = content.split('/*注意看这是分割线*/')
|
html_head, html_end = content.split('/*注意看这是分割线*/')
|
||||||
f = open(filename, 'w', encoding='utf-8')
|
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))
|
self.rangeSignal.emit(len(messages))
|
||||||
for index, message in enumerate(messages):
|
for index, message in enumerate(messages):
|
||||||
type_ = message[2]
|
type_ = message[2]
|
||||||
@ -333,7 +333,7 @@ class HtmlExporter(ExporterBase):
|
|||||||
@return:
|
@return:
|
||||||
"""
|
"""
|
||||||
self.num += 1
|
self.num += 1
|
||||||
print('子线程完成',self.num,'/',self.total_num)
|
print('子线程完成', self.num, '/', self.total_num)
|
||||||
if self.num == self.total_num:
|
if self.num == self.total_num:
|
||||||
# 所有子线程都完成之后就发送完成信号
|
# 所有子线程都完成之后就发送完成信号
|
||||||
self.okSignal.emit(1)
|
self.okSignal.emit(1)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="zh-CN">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!-- saved from url=(0211)https://lmq.music.163.com/c/year2018/EPoNy/?uid=2D7195A5E2F508DB0C6B44DAA020E46B&full_screen=true&keep_status_bar=true&top_bar_bg_color=f9f9f9&status_bar_type=dark&userid=123603375&from=timeline&isappinstalled=0 -->
|
<!-- saved from url=(0211)https://lmq.music.163.com/c/year2018/EPoNy/?uid=2D7195A5E2F508DB0C6B44DAA020E46B&full_screen=true&keep_status_bar=true&top_bar_bg_color=f9f9f9&status_bar_type=dark&userid=123603375&from=timeline&isappinstalled=0 -->
|
||||||
<html lang="en" class=" z-ios">
|
<html lang="zh-CN" class=" z-ios">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
<meta name="format-detection" content="telephone=no">
|
<meta name="format-detection" content="telephone=no">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="zh-CN">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!-- saved from url=(0167)http://m2.link/c/year2018/j3POd/?uid=53899B14C24F351212F4DC92673113FC&full_screen=true&keep_status_bar=true&top_bar_bg_color=f9f9f9&status_bar_type=dark&userid=2227269 -->
|
<!-- saved from url=(0167)http://m2.link/c/year2018/j3POd/?uid=53899B14C24F351212F4DC92673113FC&full_screen=true&keep_status_bar=true&top_bar_bg_color=f9f9f9&status_bar_type=dark&userid=2227269 -->
|
||||||
<html lang="en" class=" z-ios">
|
<html lang="zh-CN" class=" z-ios">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
Loading…
Reference in New Issue
Block a user