

def status(self, query='\n', agent=None):
    'See :func:`burpui.misc.backend.interface.BUIbackend.status`'
    result = []
    try:
        self._logger('info', "query: '{}'".format(query.rstrip()))
        qry = b''
        if (not query.endswith('\n')):
            qry += '{0}\n'.format(query).encode('utf-8')
        else:
            qry += query.encode('utf-8')
        sock = socket.socket(self.family, socket.SOCK_STREAM)
        sock.connect((self.host, self.port))
        sock.send(qry)
        sock.shutdown(socket.SHUT_WR)
        fileobj = sock.makefile()
        sock.close()
        for line in fileobj.readlines():
            line = line.rstrip('\n')
            if (not line):
                continue
            try:
                if (not PY3):
                    line = line.decode('utf-8', 'replace')
            except UnicodeDecodeError:
                pass
            result.append(line)
        fileobj.close()
        self._logger('debug', '=> {}'.format(result))
        return result
    except socket.error:
        self._logger('error', 'Cannot contact burp server at %s:%s', self.host, self.port)
        raise BUIserverException('Cannot contact burp server at {0}:{1}'.format(self.host, self.port))

dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp1.py Burp.status/original