annotate pylons_app/lib/app_globals.py @ 241:48727add84c9

Made repos path config configurable from pylons app configs. update Readme
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 30 May 2010 22:08:21 +0200
parents b18f89d6d17f
children 1ef52a70f3b7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
1 """The application's Globals object"""
113
b6e219f3a58d removed ununsed imports
Marcin Kuzminski <marcin@python-works.com>
parents: 112
diff changeset
2
43
2e1247e62c5b changed for pylons 0.1 / 1.0
marcink
parents: 31
diff changeset
3 from beaker.cache import CacheManager
2e1247e62c5b changed for pylons 0.1 / 1.0
marcink
parents: 31
diff changeset
4 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
5 from pylons_app.lib.utils import make_ui
43
2e1247e62c5b changed for pylons 0.1 / 1.0
marcink
parents: 31
diff changeset
6
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
7 class Globals(object):
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
8
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
9 """Globals acts as a container for objects available throughout the
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
10 life of the application
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
11
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
12 """
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
13
43
2e1247e62c5b changed for pylons 0.1 / 1.0
marcink
parents: 31
diff changeset
14 def __init__(self, config):
0
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
15 """One instance of Globals is created during application
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
16 initialization and is available during requests via the
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
17 'app_globals' variable
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
18
564e40829f80 initial commit.
Marcin Kuzminski
parents:
diff changeset
19 """
43
2e1247e62c5b changed for pylons 0.1 / 1.0
marcink
parents: 31
diff changeset
20 self.cache = CacheManager(**parse_cache_config_options(config))
241
48727add84c9 Made repos path config configurable from pylons app configs. update Readme
Marcin Kuzminski <marcin@python-works.com>
parents: 239
diff changeset
21 self.baseui = make_ui(config['hg_app_repo_conf'])
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
22 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
23 self.base_path = self.paths[0][1].replace('*', '')
165
ea893ffb7f00 implemented pygmentize codes into webhelpers. Together with color_dict caching into pylons globals
Marcin Kuzminski <marcin@python-works.com>
parents: 113
diff changeset
24 self.changeset_annotation_colors = {}
239
b18f89d6d17f Adde draft for permissions systems, made all needed decorators, and checks. For future usage in the system.
Marcin Kuzminski <marcin@python-works.com>
parents: 165
diff changeset
25 self.available_permissions = None # propagated after init_model