Settings.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. from core.Models import Singleton
  2. import platform
  3. @Singleton
  4. class Settings(object):
  5. # TODO review the Singleton, should be Instantiate at the BrainLoader level
  6. """
  7. This Class is a Singleton Representing the settings.yml file with synapse
  8. .. note:: the is_loaded Boolean is True when the Settings has been properly loaded.
  9. """
  10. def __init__(self,
  11. default_tts_name=None,
  12. default_stt_name=None,
  13. default_trigger_name=None,
  14. ttss=None,
  15. stts=None,
  16. random_wake_up_answers=None,
  17. random_wake_up_sounds=None,
  18. triggers=None,
  19. rest_api=None,
  20. cache_path=None,
  21. machine=None):
  22. self.default_tts_name = default_tts_name
  23. self.default_stt_name = default_stt_name
  24. self.default_trigger_name = default_trigger_name
  25. self.ttss = ttss
  26. self.stts = stts
  27. self.random_wake_up_answers = random_wake_up_answers
  28. self.random_wake_up_sounds = random_wake_up_sounds
  29. self.triggers = triggers
  30. self.rest_api = rest_api
  31. self.cache_path = cache_path
  32. self.is_loaded = False
  33. self.machine = platform.machine() # can be x86_64 or armv7l