Mercurial > public > src > rhodecode
annotate pylons_app/lib/app_globals.py @ 112:f7c403e89d5b
updated appglobals, to handle only the baseui config. removed hg app from it
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 28 Apr 2010 01:55:34 +0200 |
parents | aec4c0071cb3 |
children | b6e219f3a58d |
rev | line source |
---|---|
0 | 1 """The application's Globals object""" |
10
525ed90e4577
major app speedup moved the wsgi creation to app globals, in order to make it run only once.
Marcin Kuzminski
parents:
0
diff
changeset
|
2 #uncomment the following if you want to serve a single repo |
525ed90e4577
major app speedup moved the wsgi creation to app globals, in order to make it run only once.
Marcin Kuzminski
parents:
0
diff
changeset
|
3 #from mercurial.hgweb.hgweb_mod import hgweb |
20
bbaab7501c1a
Added custom templates, did over check of code to make it work.
Marcin Kuzminski
parents:
10
diff
changeset
|
4 import os |
43 | 5 from beaker.cache import CacheManager |
6 from beaker.util import parse_cache_config_options | |
112
f7c403e89d5b
updated appglobals, to handle only the baseui config. removed hg app from it
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
7 from pylons_app.lib.utils import make_ui |
43 | 8 |
0 | 9 class Globals(object): |
10 | |
11 """Globals acts as a container for objects available throughout the | |
12 life of the application | |
13 | |
14 """ | |
15 | |
43 | 16 def __init__(self, config): |
0 | 17 """One instance of Globals is created during application |
18 initialization and is available during requests via the | |
19 'app_globals' variable | |
20 | |
21 """ | |
43 | 22 self.cache = CacheManager(**parse_cache_config_options(config)) |
112
f7c403e89d5b
updated appglobals, to handle only the baseui config. removed hg app from it
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
23 self.baseui = make_ui('hgwebdir.config') |
f7c403e89d5b
updated appglobals, to handle only the baseui config. removed hg app from it
Marcin Kuzminski <marcin@python-works.com>
parents:
93
diff
changeset
|
24 self.paths = self.baseui.configitems('paths') |
93
aec4c0071cb3
added empty controllers for branches tags files graph, routing and test for them
Marcin Kuzminski <marcin@python-works.com>
parents:
80
diff
changeset
|
25 self.base_path = self.paths[0][1].replace('*', '') |