MCPcopy
hub / github.com/wechatpy/wechatpy / __init__

Method __init__

wechatpy/replies.py:47–64  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

45 type = 'unknown'
46
47 def __init__(self, **kwargs):
48 self._data = {}
49 message = kwargs.pop('message', None)
50 if message and isinstance(message, BaseMessage):
51 if 'source' not in kwargs:
52 kwargs['source'] = message.target
53 if 'target' not in kwargs:
54 kwargs['target'] = message.source
55 if hasattr(message, 'agent') and 'agent' not in kwargs:
56 kwargs['agent'] = message.agent
57 if 'time' not in kwargs:
58 kwargs['time'] = time.time()
59 for name, value in kwargs.items():
60 field = self._fields.get(name)
61 if field:
62 self._data[field.name] = value
63 else:
64 setattr(self, name, value)
65
66 def render(self):
67 """Render reply from Python object to XML string"""

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected