def process_message(self, request):
        if request:
            result = None
            if request.get("error"):
                # it is not supposed to get an error here
                # it should be raised by the method call
                raise RPCError(res['error']['message'])
            elif request.get('method') == 'interaction':
                self.interaction(*request.get("args"), **request.get("kwargs"))
            elif request.get('method') == 'startup':
                self.startup()
            elif request.get('method') == 'exception':
                self.exception(*request['args'])
            elif request.get('method') == 'write':
                self.write(*request.get("args"))
            elif request.get('method') == 'readline':
                result = self.readline()
            if result:
                response = {'version': '1.1', 'id': request.get('id'),
                            'result': result,
                            'error': None}
                self.send(response)
            return True
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/qdb.py/Frontend.process_message/original