Changeset - a5e719bc7b40
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-02-01 14:39:46
mads@kiilerich.com
Grafted from: a38610043006
config: fix pyflakes warning about unused tg import

app_cfg had an unused 'import tg'. tg.hooks was used, but through a separate
import. Clean that up by consistently using tg (which always makes tg.hooks
available) and dropping the separate hooks import.
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/config/app_cfg.py
Show inline comments
 
@@ -25,13 +25,12 @@ import sys
 
import alembic.config
 
import mercurial
 
import tg
 
from alembic.migration import MigrationContext
 
from alembic.script.base import ScriptDirectory
 
from sqlalchemy import create_engine
 
from tg import hooks
 
from tg.configuration import AppConfig
 
from tg.support.converters import asbool
 

	
 
import kallithea.lib.locale
 
import kallithea.model.base
 
import kallithea.model.meta
 
@@ -184,13 +183,13 @@ def setup_configuration(app):
 

	
 
    check_git_version()
 

	
 
    kallithea.model.meta.Session.remove()
 

	
 

	
 
hooks.register('configure_new_app', setup_configuration)
 
tg.hooks.register('configure_new_app', setup_configuration)
 

	
 

	
 
def setup_application(app):
 
    config = app.config
 

	
 
    # we want our low level middleware to get to the request ASAP. We don't
 
@@ -208,7 +207,7 @@ def setup_application(app):
 
    if str2bool(config.get('use_wsgi_wrapper')):
 
        app = RequestWrapper(app, config)
 

	
 
    return app
 

	
 

	
 
hooks.register('before_config', setup_application)
 
tg.hooks.register('before_config', setup_application)
0 comments (0 inline, 0 general)