Exemplo n.º 1
0
 def sendScriptResponse(self, script, level, m):
     debug('sending script response to %s: %s' % (script, str(m)))
     response = msg.ScriptResponse()
     response.response = str(m)
     response.level = level
     response.id = script.id
     response.seq = script.seq
     self.send(msg.ScriptResponseMessage(response))
p_KeyPoint << pp.Group(l \
    + p_floatXY + c \
    + p_float + c \
    + p_float + c \
    + p_float + c \
    + p_float + c \
    + p_float \
    + r)
p_KeyPoint.setParseAction(lambda x: messaging.KeyPoint(*x[0]))
p_ScriptResponse << pp.Group(l \
    + p_str + c \
    + p_DebugType + c \
    + p_str + c \
    + p_int \
    + r)
p_ScriptResponse.setParseAction(lambda x: messaging.ScriptResponse(*x[0]))
p_ScriptExecRequest << pp.Group(l \
    + p_str + c \
    + p_float + c \
    + p_str + c \
    + p_int \
    + r)
p_ScriptExecRequest.setParseAction(lambda x: messaging.ScriptExecRequest(*x[0]))

# Parse Variants
p_ParamValue_0 = l + pp.Literal('0') + c + p_int  + r
p_ParamValue_0.setParseAction(lambda x: messaging.ParamValue.create(x[1]))
p_ParamValue_1 = l + pp.Literal('1') + c + p_float  + r
p_ParamValue_1.setParseAction(lambda x: messaging.ParamValue.create(x[1]))
p_ParamValue_2 = l + pp.Literal('2') + c + p_str  + r
p_ParamValue_2.setParseAction(lambda x: messaging.ParamValue.create(x[1]))