Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

app.py 794B

1234567891011121314151617181920212223242526272829303132
  1. # encoding:utf-8
  2. import os
  3. from config import conf, load_config
  4. from channel import channel_factory
  5. from common.log import logger
  6. from plugins import *
  7. def run():
  8. try:
  9. # load config
  10. load_config()
  11. # create channel
  12. channel_name=conf().get('channel_type', 'wx')
  13. if channel_name == 'wxy':
  14. os.environ['WECHATY_LOG']="warn"
  15. # os.environ['WECHATY_PUPPET_SERVICE_ENDPOINT'] = '127.0.0.1:9001'
  16. channel = channel_factory.create_channel(channel_name)
  17. if channel_name in ['wx','wxy']:
  18. PluginManager().load_plugins()
  19. # startup channel
  20. channel.startup()
  21. except Exception as e:
  22. logger.error("App startup failed!")
  23. logger.exception(e)
  24. if __name__ == '__main__':
  25. run()