2023-11-05 21:14:14 +08:00
|
|
|
import os.path
|
|
|
|
|
2023-10-31 23:25:58 +08:00
|
|
|
from PyQt5.QtGui import QPixmap
|
|
|
|
|
2023-11-08 00:13:12 +08:00
|
|
|
from app.DataBase import data
|
|
|
|
|
|
|
|
|
|
|
|
# from app.Ui.Icon import Icon
|
2023-10-30 23:55:26 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Person:
|
|
|
|
def __init__(self, wxid: str):
|
|
|
|
self.wxid = wxid
|
2023-10-31 23:25:58 +08:00
|
|
|
self.conRemark = data.get_conRemark(wxid)
|
|
|
|
self.nickname, self.alias = data.get_nickname(wxid)
|
2023-10-30 23:55:26 +08:00
|
|
|
self.avatar_path = data.get_avator(wxid)
|
2023-11-05 21:14:14 +08:00
|
|
|
if os.path.exists(self.avatar_path):
|
|
|
|
self.avatar = QPixmap(self.avatar_path).scaled(60, 60)
|
|
|
|
else:
|
2023-11-08 00:13:12 +08:00
|
|
|
self.avatar_path = './app/data/icons/default_avatar.svg'
|
|
|
|
# self.avatar_path = Icon.Default_avatar_path
|
2023-11-05 21:14:14 +08:00
|
|
|
self.avatar = QPixmap(self.avatar_path).scaled(60, 60)
|
2023-10-31 23:25:58 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Me(Person):
|
|
|
|
def __init__(self, wxid: str):
|
|
|
|
super(Me, self).__init__(wxid)
|
|
|
|
self.city = None
|
|
|
|
self.province = None
|
|
|
|
|
|
|
|
|
|
|
|
class Contact(Person):
|
|
|
|
def __init__(self, wxid: str):
|
|
|
|
super(Contact, self).__init__(wxid)
|
|
|
|
|
|
|
|
|
|
|
|
class Group(Person):
|
|
|
|
def __init__(self, wxid: str):
|
|
|
|
super(Group, self).__init__(wxid)
|