changeset 8546:f644fc6bbfc3

tg: drop kallithea.config.environment - it doesn't do much and isn't a TG 2.4 convention
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 23 Apr 2020 22:22:48 +0200
parents 3a02b678b5e7
children 0619fe53ff6d
files kallithea/config/application.py kallithea/config/environment.py kallithea/tests/scripts/manual_test_concurrency.py
diffstat 3 files changed, 3 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/config/application.py	Thu Apr 23 21:45:27 2020 +0200
+++ b/kallithea/config/application.py	Thu Apr 23 22:22:48 2020 +0200
@@ -14,11 +14,11 @@
 """WSGI middleware initialization for the Kallithea application."""
 
 from kallithea.config.app_cfg import base_config
-from kallithea.config.environment import load_environment
 
 
 __all__ = ['make_app']
 
+load_environment = base_config.make_load_environment()
 # Use base_config to setup the necessary PasteDeploy application factory.
 # make_base_app will wrap the TurboGears2 app with all the middleware it needs.
 make_base_app = base_config.setup_tg_wsgi_app(load_environment)
--- a/kallithea/config/environment.py	Thu Apr 23 21:45:27 2020 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""WSGI environment setup for Kallithea."""
-
-from kallithea.config.app_cfg import base_config
-
-
-__all__ = ['load_environment']
-
-# Use base_config to setup the environment loader function
-load_environment = base_config.make_load_environment()
--- a/kallithea/tests/scripts/manual_test_concurrency.py	Thu Apr 23 21:45:27 2020 +0200
+++ b/kallithea/tests/scripts/manual_test_concurrency.py	Thu Apr 23 22:22:48 2020 +0200
@@ -37,7 +37,7 @@
 from paste.deploy import appconfig
 from sqlalchemy import engine_from_config
 
-from kallithea.config.environment import load_environment
+import kallithea.config.application
 from kallithea.lib.auth import get_crypt_password
 from kallithea.model import meta
 from kallithea.model.base import init_model
@@ -47,7 +47,7 @@
 
 rel_path = dirname(dirname(dirname(dirname(os.path.abspath(__file__)))))
 conf = appconfig('config:development.ini', relative_to=rel_path)
-load_environment(conf.global_conf, conf.local_conf)
+kallithea.config.application.make_app(conf.global_conf, **conf.local_conf)
 
 USER = TEST_USER_ADMIN_LOGIN
 PASS = TEST_USER_ADMIN_PASS