Mercurial > kallithea
comparison pylons_app/config/environment.py @ 341:1ef52a70f3b7
Made config file free configuration based on database and capable of beeing manage via application settings + some code cleanups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 14 Jul 2010 02:28:32 +0200 |
parents | 7e4771a0ff43 |
children | ec7b76d4bda4 |
comparison
equal
deleted
inserted
replaced
340:71f25781079d | 341:1ef52a70f3b7 |
---|---|
2 from mako.lookup import TemplateLookup | 2 from mako.lookup import TemplateLookup |
3 from pylons.configuration import PylonsConfig | 3 from pylons.configuration import PylonsConfig |
4 from pylons.error import handle_mako_error | 4 from pylons.error import handle_mako_error |
5 from pylons_app.config.routing import make_map | 5 from pylons_app.config.routing import make_map |
6 from pylons_app.lib.auth import set_available_permissions, set_base_path | 6 from pylons_app.lib.auth import set_available_permissions, set_base_path |
7 from pylons_app.lib.utils import repo2db_mapper | 7 from pylons_app.lib.utils import repo2db_mapper, make_ui, set_hg_app_config |
8 from pylons_app.model import init_model | 8 from pylons_app.model import init_model |
9 from pylons_app.model.hg_model import _get_repos_cached_initial | 9 from pylons_app.model.hg_model import _get_repos_cached_initial |
10 from sqlalchemy import engine_from_config | 10 from sqlalchemy import engine_from_config |
11 import logging | 11 import logging |
12 import os | 12 import os |
59 proxy=TimerProxy()) | 59 proxy=TimerProxy()) |
60 else: | 60 else: |
61 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') | 61 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') |
62 | 62 |
63 init_model(sa_engine_db1) | 63 init_model(sa_engine_db1) |
64 config['pylons.app_globals'].baseui = make_ui('db') | |
65 | |
64 repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'])) | 66 repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'])) |
65 set_available_permissions(config) | 67 set_available_permissions(config) |
66 set_base_path(config) | 68 set_base_path(config) |
69 set_hg_app_config(config) | |
67 # CONFIGURATION OPTIONS HERE (note: all config options will override | 70 # CONFIGURATION OPTIONS HERE (note: all config options will override |
68 # any Pylons config options) | 71 # any Pylons config options) |
69 | 72 |
70 return config | 73 return config |