File size: 455 Bytes
78d94c0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
"""
channel factory
"""
def create_channel(channel_type):
"""
create a channel instance
:param channel_type: channel type code
:return: channel instance
"""
if channel_type == 'wx':
from channel.wechat.wechat_channel import WechatChannel
return WechatChannel()
elif channel_type == 'wxy':
from channel.wechat.wechaty_channel import WechatyChannel
return WechatyChannel()
raise RuntimeError
|