def dispatch_messages(socket):
    while True:
        request = read_message(socket, Message())
        response = Message()
        processors[request.messageType](request, response, socket)
        if request.messageType != Message.CacheFileRequest:
            send_message(response, request, socket)
Beispiel #2
0
def get_step_value(step_text):
    global _api
    if _api is None:
        return re.sub('<[^<]+?>', '{}', step_text)
    req = APIMessage()
    req.stepValueRequest.stepText = step_text
    req.stepValueRequest.hasInlineTable = False
    req.messageType = APIMessage.GetStepValueRequest
    req.messageId = random.getrandbits(8)
    connection.send_message(req, req, _api)
    res = connection.read_message(_api, APIMessage())
    return res.stepValueResponse.stepValue.stepValue
Beispiel #3
0
def dispatch_messages(socket):
    while True:
        request = read_message(socket, Message())
        response = Message()

        try:
            processors[request.messageType](request, response, socket)
        except Exception as e:
            response = Message()
            response.messageType = Message.ExecutionStatusResponse
            response.executionStatusResponse.executionResult.failed = True
            response.executionStatusResponse.executionResult.errorMessage = str(
                e)
            response.executionStatusResponse.executionResult.stackTrace = traceback.format_exc()

        if request.messageType != Message.CacheFileRequest:
            send_message(response, request, socket)
Beispiel #4
0
def dispatch_messages(socket):
    while True:
        request = read_message(socket, Message())
        response = Message()
        processors[request.messageType](request, response, socket)
        send_message(response, request, socket)