__init__.py 804 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import logging
  2. import console
  3. import conf
  4. SERVICES = []
  5. def init_services(cclient):
  6. global SERVICES
  7. SERVICES = [
  8. console.Console(cclient),
  9. ]
  10. if conf.SOUND_OUTPUT_ENABLED:
  11. import audio_output
  12. SERVICES.append(audio_output.AudioOutput())
  13. if conf.SLACK_BOT_API_KEY:
  14. import slack_bot
  15. SERVICES.append(slack_bot.SlackBot())
  16. def success():
  17. for service in SERVICES:
  18. service.success()
  19. def failure(s=None):
  20. for service in SERVICES:
  21. service.failure(s)
  22. def cancelled():
  23. for service in SERVICES:
  24. service.cancelled()
  25. def tts(s):
  26. for service in SERVICES:
  27. service.tts(s)
  28. def text(s):
  29. for service in SERVICES:
  30. service.text(s)
  31. def debug(s):
  32. for service in SERVICES:
  33. service.debug(s)