Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #configuration.py
- 4 USER = ''
- #communicator.py
- 10 def login(username,password):
- 9 f = open(USER_PATH, 'r')
- 8 global USER
- 7 while True:
- 6 line = f.readline()
- 5 if len(line) == 0:
- 4 login_status_label.set_label("No user found")
- 3 break
- 2 data = line.split(",")
- 1 if data[0] == username:
- 65 if data[4] == password:
- 1 login_status_label.set_label("Success!")
- 2 USER = username
- 3 authorize.close()
- 4 break
- 5 else:
- 6 login_status_label.set_label("Incorrect Passwo
- 7 break
- 8 if USER != '':
- 9 login_button.set_label(USER)
- #handler.py
- 15 def on_submitButton_clicked(self, *args):
- 16 info_buffer = info_display.get_buffer()
- 17 chat_input = chat_entry.get_text()
- 18 if (chat_input != ""):
- 19 chat_input += '\n'
- 20 info_buffer.insert(info_buffer.get_end_iter(),USER + "
- 21 f = open(ACTIVE_LOG_PATH, 'a')
- 22 f.write(USER + ": " + chat_input)
- 23 f.close()
- 24 chat_entry.set_text("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement