改进部分代码,增加Linux可运行的版本,可自己选择想要进入的房间

Signed-off-by: Jerry Yan <792602257@qq.com>
This commit is contained in:
2019-01-20 23:10:35 +08:00
parent c3015eba65
commit ab06868f06
5 changed files with 316 additions and 191 deletions

23
Chat.py Normal file
View File

@ -0,0 +1,23 @@
from User import User
class Chat:
content:str=""
user:User=None
def __init__(self, json=None):
if json:
self.parse(json)
def parse(self, json):
self.user = User(json)
if "Msg" in json:
if "content" in json["Msg"]:
self.content = json["Msg"]['content']
def __str__(self):
return "{} : {}".format(self.user,self.content)
def __unicode__(self):
return self.__str__()