/shabti/templates/shenu/+package+/lib/app_globals.py_tmpl

https://bitbucket.org/gawel/shabti · Unknown · 19 lines · 16 code · 3 blank · 0 comment · 0 complexity · 8714c5b235af300b10f8fb13d1f7d4d8 MD5 · raw file

  1. """The application's Globals object"""
  2. from pylons import config
  3. from beaker.cache import CacheManager
  4. from beaker.util import parse_cache_config_options
  5. class Globals(object):
  6. """Globals acts as a container for objects available throughout the
  7. life of the application
  8. """
  9. def __init__(self, config):
  10. """One instance of Globals is created during application
  11. initialization and is available during requests via the
  12. 'app_globals' variable
  13. """
  14. self.cache = CacheManager(**parse_cache_config_options(config))
  15. import pylons
  16. self.version = pylons.__version__