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 455B

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