-
Notifications
You must be signed in to change notification settings - Fork 3
/
botton_click.py
34 lines (29 loc) · 922 Bytes
/
botton_click.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import chat_client_class as cmclass
def log_in_botton(user_name,label):
# copied from chat_cmdl_client
import argparse
parser = argparse.ArgumentParser(description='chat client argument')
parser.add_argument('-d', type=str, default=None, help='server IP addr')
args = parser.parse_args()
# end of copy
user = cmclass.Client(args)
# initial the chat manually
user.init_chat()
if user_name == '':
label.setText('please enter a valid user name')
logged = False
else:
user.console_input.append(user_name)
login_status = user.login()
if login_status:
logged = True
else:
text = user.system_msg
label.setText(text)
logged = False
return logged,user
def send_button(user,text):
user.console_input.append(text)
#user.proc()
#message = user.output()
#return message