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