diff pylons_app/lib/app_globals.py @ 43:2e1247e62c5b

changed for pylons 0.1 / 1.0 added admin controller
author marcink
date Wed, 07 Apr 2010 15:28:50 +0200
parents 2963f2894a7a
children e00dccb6f211
line wrap: on
line diff
--- a/pylons_app/lib/app_globals.py	Wed Apr 07 13:24:46 2010 +0200
+++ b/pylons_app/lib/app_globals.py	Wed Apr 07 15:28:50 2010 +0200
@@ -6,6 +6,9 @@
 from mercurial.hgweb.request import wsgiapplication
 from mercurial import ui, config
 import os
+from beaker.cache import CacheManager
+from beaker.util import parse_cache_config_options
+
 class Globals(object):
 
     """Globals acts as a container for objects available throughout the
@@ -13,7 +16,7 @@
 
     """
 
-    def __init__(self):
+    def __init__(self, config):
         """One instance of Globals is created during application
         initialization and is available during requests via the
         'app_globals' variable
@@ -22,6 +25,7 @@
         #two ways of building the merc app i don't know 
         #the fastest one but belive the wsgiapp is better
         #self.hgapp = self.make_web_app()
+        self.cache = CacheManager(**parse_cache_config_options(config))
         self.hgapp = wsgiapplication(self.make_web_app)