Beispiel #1
0
    def workerThread1(self):
        """
        This is where we handle the asynchronous I/O. For example, it may be
        a 'select()'.
        One important thing to remember is that the thread has to yield
        control.
        """
        ChatClient.connect()

        while self.running:

            message = ChatClient.listener()
            if message is not None and len(message) > 1:
                self.queue.put(message)
Beispiel #2
0
def start():
    global client
    client = ChatClient()
    global login_frame
    login_frame = LoginPanel(login, register, close_login_window)
    login_frame.show()
Beispiel #3
0
def send(message, instance):
    msg = "[Me]: " + message + "\n"
    ChatClient.send_message(message + "\n")
    instance.text_input.delete(0, END)
    instance.queue.put(msg)
Beispiel #4
0
def exit_chat():
    ChatClient.exit()
    client.endApplication()
    sys.exit()