diff --git a/app/DataBase/exporter_csv.py b/app/DataBase/exporter_csv.py index 541c19eb..55b2e124 100644 --- a/app/DataBase/exporter_csv.py +++ b/app/DataBase/exporter_csv.py @@ -24,7 +24,11 @@ def to_csv(self): writer = csv.writer(file) writer.writerow(columns) # 写入数据 - writer.writerows(messages) + # writer.writerows(messages) + for msg in messages: + other_data = [msg[12].remark, msg[12].nickName, msg[12].wxid] if self.contact.is_chatroom else [] + writer.writerow([*msg[:9], *other_data]) self.okSignal.emit('ok') + def run(self): - self.to_csv() \ No newline at end of file + self.to_csv() diff --git a/app/person.py b/app/person.py index 2f05bb05..9cb416e0 100644 --- a/app/person.py +++ b/app/person.py @@ -61,6 +61,8 @@ def __init__(self): self.name = '' self.mobile = '' self.smallHeadImgUrl = '' + self.nickName = self.name + self.remark = self.nickName class Contact(Person): @@ -79,7 +81,7 @@ def __init__(self, contact_info: Dict): self.avatar_path = Icon.Default_avatar_path self.is_chatroom = self.wxid.__contains__('@chatroom') self.detail = contact_info.get('detail') - self.label_name = contact_info.get('label_name') # 联系人的标签分类 + self.label_name = contact_info.get('label_name') # 联系人的标签分类 """ detail存储了联系人的详细信息,是个字典