]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/blobdiff - wradmin/lib/app_globals.py
Additional cleanup.
[philipp/winterrodeln/wradmin.git] / wradmin / lib / app_globals.py
diff --git a/wradmin/lib/app_globals.py b/wradmin/lib/app_globals.py
new file mode 100644 (file)
index 0000000..2366bba
--- /dev/null
@@ -0,0 +1,19 @@
+"""The application's Globals object"""
+
+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
+    life of the application
+
+    """
+
+    def __init__(self, config):
+        """One instance of Globals is created during application
+        initialization and is available during requests via the
+        'app_globals' variable
+
+        """
+        self.cache = CacheManager(**parse_cache_config_options(config))