You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

channel_factory.py 441B

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