##// END OF EJS Templates
core: code refactor and cleanups for easier pylons porting.
marcink -
r2321:a29db630 default
parent child Browse files
Show More
@@ -25,13 +25,8 b' Pylons environment configuration'
25 25 import os
26 26 import logging
27 27 import rhodecode
28 import platform
29 import re
30 import io
31 28
32 29 from mako.lookup import TemplateLookup
33 from pylons.configuration import PylonsConfig
34 from pylons.error import handle_mako_error
35 30 from pyramid.settings import asbool
36 31
37 32 # ------------------------------------------------------------------------------
@@ -46,25 +41,25 b' import rhodecode.integrations '
46 41 from rhodecode.lib import app_globals
47 42 from rhodecode.config import utils
48 43 from rhodecode.config.routing import make_map
49 from rhodecode.config.jsroutes import generate_jsroutes_content
50 44
51 45 from rhodecode.lib import helpers
52 from rhodecode.lib.auth import set_available_permissions
53 46 from rhodecode.lib.utils import (
54 repo2db_mapper, make_db_config, set_rhodecode_config,
55 load_rcextensions)
47 make_db_config, set_rhodecode_config, load_rcextensions)
56 48 from rhodecode.lib.utils2 import str2bool, aslist
57 49 from rhodecode.lib.vcs import connect_vcs, start_vcs_server
58 from rhodecode.model.scm import ScmModel
59 50
60 51 log = logging.getLogger(__name__)
61 52
53
62 54 def load_environment(global_conf, app_conf, initial=False,
63 55 test_env=None, test_index=None):
64 56 """
65 57 Configure the Pylons environment via the ``pylons.config``
66 58 object
67 59 """
60 from pylons.configuration import PylonsConfig
61 from pylons.error import handle_mako_error
62
68 63 config = PylonsConfig()
69 64
70 65
@@ -23,11 +23,10 b' Pylons middleware initialization'
23 23 """
24 24 import logging
25 25 import traceback
26 from collections import OrderedDict
26 import collections
27 27
28 28 from paste.registry import RegistryManager
29 29 from paste.gzipper import make_gzip_middleware
30 from pylons.wsgiapp import PylonsApp
31 30 from pyramid.authorization import ACLAuthorizationPolicy
32 31 from pyramid.config import Configurator
33 32 from pyramid.settings import asbool, aslist
@@ -101,6 +100,8 b' def make_app(global_conf, static_files=T'
101 100 defaults to main).
102 101
103 102 """
103 from pylons.wsgiapp import PylonsApp
104
104 105 # Apply compatibility patches
105 106 patches.kombu_1_5_1_python_2_7_11()
106 107 patches.inspect_getargspec()
@@ -267,7 +268,7 b' def includeme(config):'
267 268 settings = config.registry.settings
268 269
269 270 # plugin information
270 config.registry.rhodecode_plugins = OrderedDict()
271 config.registry.rhodecode_plugins = collections.OrderedDict()
271 272
272 273 config.add_directive(
273 274 'register_rhodecode_plugin', register_rhodecode_plugin)
General Comments 0
You need to be logged in to leave comments. Login now