Show More
@@ -1,25 +1,23 b'' | |||||
1 | """The application's Globals object""" |
|
1 | """The application's Globals object""" | |
2 | #uncomment the following if you want to serve a single repo |
|
2 | ||
3 | #from mercurial.hgweb.hgweb_mod import hgweb |
|
|||
4 | import os |
|
|||
5 | from beaker.cache import CacheManager |
|
3 | from beaker.cache import CacheManager | |
6 | from beaker.util import parse_cache_config_options |
|
4 | from beaker.util import parse_cache_config_options | |
7 | from pylons_app.lib.utils import make_ui |
|
5 | from pylons_app.lib.utils import make_ui | |
8 |
|
6 | |||
9 | class Globals(object): |
|
7 | class Globals(object): | |
10 |
|
8 | |||
11 | """Globals acts as a container for objects available throughout the |
|
9 | """Globals acts as a container for objects available throughout the | |
12 | life of the application |
|
10 | life of the application | |
13 |
|
11 | |||
14 | """ |
|
12 | """ | |
15 |
|
13 | |||
16 | def __init__(self, config): |
|
14 | def __init__(self, config): | |
17 | """One instance of Globals is created during application |
|
15 | """One instance of Globals is created during application | |
18 | initialization and is available during requests via the |
|
16 | initialization and is available during requests via the | |
19 | 'app_globals' variable |
|
17 | 'app_globals' variable | |
20 |
|
18 | |||
21 | """ |
|
19 | """ | |
22 | self.cache = CacheManager(**parse_cache_config_options(config)) |
|
20 | self.cache = CacheManager(**parse_cache_config_options(config)) | |
23 | self.baseui = make_ui('hgwebdir.config') |
|
21 | self.baseui = make_ui('hgwebdir.config') | |
24 | self.paths = self.baseui.configitems('paths') |
|
22 | self.paths = self.baseui.configitems('paths') | |
25 | self.base_path = self.paths[0][1].replace('*', '') |
|
23 | self.base_path = self.paths[0][1].replace('*', '') |
General Comments 0
You need to be logged in to leave comments.
Login now