MCPcopy Index your code
hub / github.com/offu/WeRoBot / process_message

Function process_message

werobot/parser.py:19–33  ·  view source on GitHub ↗

Process a message dict and return a Message Object :param message: Message dict returned by `parse_xml` function :return: Message Object

(message)

Source from the content-addressed store, hash-verified

17
18
19def process_message(message):
20 """
21 Process a message dict and return a Message Object
22 :param message: Message dict returned by `parse_xml` function
23 :return: Message Object
24 """
25 message["type"] = message.pop("MsgType").lower()
26 if message["type"] == 'event':
27 message["type"] = str(message.pop("Event")).lower() + '_event'
28 message_type = EventMetaClass.TYPES.get(message["type"], UnknownEvent)
29 else:
30 message_type = MessageMetaClass.TYPES.get(
31 message["type"], UnknownMessage
32 )
33 return message_type(message)

Callers 5

parse_messageMethod · 0.90
testerFunction · 0.90
test_djangoFunction · 0.90
test_tornadoMethod · 0.90
parse_user_msgFunction · 0.85

Calls 1

getMethod · 0.45

Tested by 3

testerFunction · 0.72
test_djangoFunction · 0.72
test_tornadoMethod · 0.72