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