Exemplo n.º 1
0
        def save_person_user():
            name = self.ui.edit_name.text()
            ip = self.ui.edit_ip.text()

            if self.current_user is not None:
                self.ui.table_user.itemFromIndex(self.current_user[0]).setText(0, name)
                user = self.current_user[1]
            else:
                user = PersonUser(name, ip)

            user.name = name
            user.ip = ip

            self.ui.edit_name.setText('')
            self.ui.edit_ip.setText('')
            self.ui.frame_user.setEnabled(False)
Exemplo n.º 2
0
    def handle(self):
        self.buffer = buffer.Buffer(self.request)
        ip = self.client_address[0]
        self.user = PersonUser.get(ip, ip)
        #print('TCP Connection:', self.user)
        logger.debug(type='tcp', action='connection',
                     user=[self.user.ip, self.user.name],
                     content=None)

        while True:
            try:
                content = self.read_command()
            except buffer.SocketClosedError:
                return
            self.handle_content(content)