Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- """
- 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()
- elif channel_type == 'terminal':
- from channel.terminal.terminal_channel import TerminalChannel
- return TerminalChannel()
- raise RuntimeError
|