Mercurial > kallithea
comparison pylons_app/config/environment.py @ 265:0e5455fda8fd
Implemented basic repository managment. Implemented repo2db mappings, model, helpers updates and code cleanups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 07 Jun 2010 00:18:33 +0200 |
parents | 3782a6d698af |
children | 8f7b8e965fe4 |
comparison
equal
deleted
inserted
replaced
264:0d68a749db33 | 265:0e5455fda8fd |
---|---|
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 | 6 from pylons_app.lib.auth import set_available_permissions |
7 from pylons_app.lib.utils import repo2db_mapper | 7 from pylons_app.lib.utils import repo2db_mapper |
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 sqlalchemy import engine_from_config | 10 from sqlalchemy import engine_from_config |
10 import logging | 11 import logging |
11 import os | 12 import os |
12 import pylons_app.lib.app_globals as app_globals | 13 import pylons_app.lib.app_globals as app_globals |
13 import pylons_app.lib.helpers | 14 import pylons_app.lib.helpers |
58 proxy=TimerProxy()) | 59 proxy=TimerProxy()) |
59 else: | 60 else: |
60 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') | 61 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') |
61 | 62 |
62 init_model(sa_engine_db1) | 63 init_model(sa_engine_db1) |
63 repo2db_mapper() | 64 repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'])) |
64 set_available_permissions(config) | 65 set_available_permissions(config) |
65 # CONFIGURATION OPTIONS HERE (note: all config options will override | 66 # CONFIGURATION OPTIONS HERE (note: all config options will override |
66 # any Pylons config options) | 67 # any Pylons config options) |
67 | 68 |
68 return config | 69 return config |