core: code refactor and cleanups for easier pylons porting.
This commit is contained in:
parent
ecbc7c5824
commit
b3a2a6ad45
2 changed files with 9 additions and 13 deletions
|
|
@ -25,13 +25,8 @@ Pylons environment configuration
|
|||
import os
|
||||
import logging
|
||||
import rhodecode
|
||||
import platform
|
||||
import re
|
||||
import io
|
||||
|
||||
from mako.lookup import TemplateLookup
|
||||
from pylons.configuration import PylonsConfig
|
||||
from pylons.error import handle_mako_error
|
||||
from pyramid.settings import asbool
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
@ -46,25 +41,25 @@ import rhodecode.integrations # any modules using celery task
|
|||
from rhodecode.lib import app_globals
|
||||
from rhodecode.config import utils
|
||||
from rhodecode.config.routing import make_map
|
||||
from rhodecode.config.jsroutes import generate_jsroutes_content
|
||||
|
||||
from rhodecode.lib import helpers
|
||||
from rhodecode.lib.auth import set_available_permissions
|
||||
from rhodecode.lib.utils import (
|
||||
repo2db_mapper, make_db_config, set_rhodecode_config,
|
||||
load_rcextensions)
|
||||
make_db_config, set_rhodecode_config, load_rcextensions)
|
||||
from rhodecode.lib.utils2 import str2bool, aslist
|
||||
from rhodecode.lib.vcs import connect_vcs, start_vcs_server
|
||||
from rhodecode.model.scm import ScmModel
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def load_environment(global_conf, app_conf, initial=False,
|
||||
test_env=None, test_index=None):
|
||||
"""
|
||||
Configure the Pylons environment via the ``pylons.config``
|
||||
object
|
||||
"""
|
||||
from pylons.configuration import PylonsConfig
|
||||
from pylons.error import handle_mako_error
|
||||
|
||||
config = PylonsConfig()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@ Pylons middleware initialization
|
|||
"""
|
||||
import logging
|
||||
import traceback
|
||||
from collections import OrderedDict
|
||||
import collections
|
||||
|
||||
from paste.registry import RegistryManager
|
||||
from paste.gzipper import make_gzip_middleware
|
||||
from pylons.wsgiapp import PylonsApp
|
||||
from pyramid.authorization import ACLAuthorizationPolicy
|
||||
from pyramid.config import Configurator
|
||||
from pyramid.settings import asbool, aslist
|
||||
|
|
@ -101,6 +100,8 @@ def make_app(global_conf, static_files=True, **app_conf):
|
|||
defaults to main).
|
||||
|
||||
"""
|
||||
from pylons.wsgiapp import PylonsApp
|
||||
|
||||
# Apply compatibility patches
|
||||
patches.kombu_1_5_1_python_2_7_11()
|
||||
patches.inspect_getargspec()
|
||||
|
|
@ -267,7 +268,7 @@ def includeme(config):
|
|||
settings = config.registry.settings
|
||||
|
||||
# plugin information
|
||||
config.registry.rhodecode_plugins = OrderedDict()
|
||||
config.registry.rhodecode_plugins = collections.OrderedDict()
|
||||
|
||||
config.add_directive(
|
||||
'register_rhodecode_plugin', register_rhodecode_plugin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue