comparison 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
comparison
equal deleted inserted replaced
42:b2bc08f2974b 43:2e1247e62c5b
4 from mercurial.hgweb.hgwebdir_mod import hgwebdir 4 from mercurial.hgweb.hgwebdir_mod import hgwebdir
5 from mercurial import templater 5 from mercurial import templater
6 from mercurial.hgweb.request import wsgiapplication 6 from mercurial.hgweb.request import wsgiapplication
7 from mercurial import ui, config 7 from mercurial import ui, config
8 import os 8 import os
9 from beaker.cache import CacheManager
10 from beaker.util import parse_cache_config_options
11
9 class Globals(object): 12 class Globals(object):
10 13
11 """Globals acts as a container for objects available throughout the 14 """Globals acts as a container for objects available throughout the
12 life of the application 15 life of the application
13 16
14 """ 17 """
15 18
16 def __init__(self): 19 def __init__(self, config):
17 """One instance of Globals is created during application 20 """One instance of Globals is created during application
18 initialization and is available during requests via the 21 initialization and is available during requests via the
19 'app_globals' variable 22 'app_globals' variable
20 23
21 """ 24 """
22 #two ways of building the merc app i don't know 25 #two ways of building the merc app i don't know
23 #the fastest one but belive the wsgiapp is better 26 #the fastest one but belive the wsgiapp is better
24 #self.hgapp = self.make_web_app() 27 #self.hgapp = self.make_web_app()
28 self.cache = CacheManager(**parse_cache_config_options(config))
25 self.hgapp = wsgiapplication(self.make_web_app) 29 self.hgapp = wsgiapplication(self.make_web_app)
26 30
27 31
28 def make_web_app(self): 32 def make_web_app(self):
29 repos = "hgwebdir.config" 33 repos = "hgwebdir.config"