env.py 720 B

12345678910111213141516171819202122232425
  1. import threading
  2. '''
  3. Global bucket for switching configuration. Different environments
  4. (e.g. webapp, test suite) put the appropriate value in it.
  5. The most important values to be stored are app_conf (either from
  6. lakesuperior.config_parser.config or lakesuperior.config_parser.test_config)
  7. and app_globals (obtained by an instance of lakesuperior.globals.AppGlobals).
  8. e.g.:
  9. >>> from lakesuperior.config_parser import config
  10. >>> from lakesuperior.globals import AppGlobals
  11. >>> from lakesuperior.env import env
  12. >>> env.config = config
  13. >>> env.app_globals = AppGlobals(config)
  14. This is automated in non-test environments by importing
  15. `lakesuperior.env_setup`.
  16. '''
  17. class Env:
  18. pass
  19. env = Env()
  20. #env = threading.local()