移除pandas

This commit is contained in:
shuaikangzhou 2023-11-25 00:40:09 +08:00
parent df26aaead8
commit 7a7ed1ae75
4 changed files with 53 additions and 37 deletions

View File

@ -4,16 +4,10 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="支持显示表情包">
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="修复第一次启动的问题">
<change afterPath="$PROJECT_DIR$/requirements_pc.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/DataBase/msg.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/msg.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/chat/chat_info.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/chat/chat_info.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/chat/chat_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/chat/chat_window.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainview.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/pc_decrypt/pc_decrypt.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/pc_decrypt/pc_decrypt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/util/path.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/util/path.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/DataBase/output_pc.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/output_pc.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -26,6 +20,7 @@
<option value="Freeze Requirements File" />
<option value="HTML File" />
<option value="Python Script" />
<option value="Blank Requirements File" />
</list>
</option>
</component>
@ -273,13 +268,6 @@
<option name="presentableId" value="Default" />
<updated>1672848140146</updated>
</task>
<task id="LOCAL-00039" summary="替换chat里的contact">
<created>1698940208580</created>
<option name="number" value="00039" />
<option name="presentableId" value="LOCAL-00039" />
<option name="project" value="LOCAL" />
<updated>1698940208580</updated>
</task>
<task id="LOCAL-00040" summary="增加中文路径提示">
<created>1699025065814</created>
<option name="number" value="00040" />
@ -616,7 +604,14 @@
<option name="project" value="LOCAL" />
<updated>1700840978590</updated>
</task>
<option name="localTasksCounter" value="88" />
<task id="LOCAL-00088" summary="修复第一次启动的问题">
<created>1700842837452</created>
<option name="number" value="00088" />
<option name="presentableId" value="LOCAL-00088" />
<option name="project" value="LOCAL" />
<updated>1700842837452</updated>
</task>
<option name="localTasksCounter" value="89" />
<servers />
</component>
<component name="UnknownFeatures">
@ -652,7 +647,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="新增联系人头像组件" />
<MESSAGE value="头像支持显示二进制" />
<MESSAGE value="显示联系人信息" />
<MESSAGE value="修复db文件空格路径的bug" />
@ -677,7 +671,8 @@
<MESSAGE value="添加资源文件" />
<MESSAGE value="修改文本消息宽度" />
<MESSAGE value="支持显示表情包" />
<option name="LAST_COMMIT_MESSAGE" value="支持显示表情包" />
<MESSAGE value="修复第一次启动的问题" />
<option name="LAST_COMMIT_MESSAGE" value="修复第一次启动的问题" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
</component>

View File

@ -1,6 +1,6 @@
import csv
import os
import pandas as pd
from PyQt5.QtCore import pyqtSignal, QThread
from . import msg
@ -36,21 +36,7 @@ class Output(QThread):
@log
def to_csv(self, conRemark, path):
origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}"
if not os.path.exists(origin_docx_path):
os.mkdir(origin_docx_path)
filename = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}/{self.contact.remark}.csv"
# columns = ["用户名", "消息内容", "发送时间", "发送状态", "消息类型", "isSend", "msgId"]
columns = ['localId', 'TalkerId', 'Type', 'SubType',
'IsSender', 'CreateTime', 'Status', 'StrContent',
'StrTime']
messages = msg.get_messages(self.contact.wxid)
# print()
df = pd.DataFrame(
data=messages,
columns=columns,
)
df.to_csv(filename, encoding='utf-8')
self.okSignal.emit('ok')
def to_html(self):
@ -72,7 +58,11 @@ class Output(QThread):
return
elif self.output_type == self.CSV:
# print("线程导出csv")
self.to_csv(self.ta_username, "path")
self.Child0 = ChildThread(self.contact, type_=ChildThread.CSV)
self.Child0.progressSignal.connect(self.progress)
self.Child0.rangeSignal.connect(self.rangeSignal)
self.Child0.okSignal.connect(self.okSignal)
self.Child0.run()
elif self.output_type == self.HTML:
# self.to_html()
self.Child0 = ChildThread(self.contact, type_=ChildThread.HTML)
@ -134,6 +124,24 @@ class ChildThread(QThread):
def video(self, doc, isSend, content, status, img_path):
return
def to_csv(self):
origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}"
if not os.path.exists(origin_docx_path):
os.mkdir(origin_docx_path)
filename = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}/{self.contact.remark}.csv"
# columns = ["用户名", "消息内容", "发送时间", "发送状态", "消息类型", "isSend", "msgId"]
columns = ['localId', 'TalkerId', 'Type', 'SubType',
'IsSender', 'CreateTime', 'Status', 'StrContent',
'StrTime']
messages = msg.get_messages(self.contact.wxid)
# 写入CSV文件
with open(filename, mode='w', newline='', encoding='utf-8') as file:
writer = csv.writer(file)
writer.writerow(columns)
# 写入数据
writer.writerows(messages)
self.okSignal.emit('ok')
def to_html(self):
origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}"
if not os.path.exists(origin_docx_path):
@ -729,6 +737,6 @@ const chatMessages = [
if self.output_type == self.DOCX:
return
elif self.output_type == self.CSV:
return
self.to_csv()
elif self.output_type == self.HTML:
self.to_html_()

View File

@ -151,6 +151,8 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
'mobile': self.info['mobile']
}
try:
if not os.path.exists('./app/data'):
os.mkdir('./app/data')
with open('./app/data/info.json', 'w', encoding='utf-8') as f:
f.write(json.dumps(dic))
except:

11
requirements_pc.txt Normal file
View File

@ -0,0 +1,11 @@
PyQt5
psutil
pycryptodomex
pywin32
pymem
silk-python
pyaudio
fuzzywuzzy
python-Levenshtein
pillow
requests