# HG changeset patch # User Mads Kiilerich # Date 1440084595 -7200 # Node ID 33249f840ecd06572c3fd646bd62ebcbd9bcbaee # Parent 4f6a90fe63a1fb0d36084d7032536eadcd229541 config: simplify some imports diff -r 4f6a90fe63a1 -r 33249f840ecd kallithea/config/environment.py --- a/kallithea/config/environment.py Thu Aug 20 17:29:55 2015 +0200 +++ b/kallithea/config/environment.py Thu Aug 20 17:29:55 2015 +0200 @@ -20,9 +20,9 @@ import kallithea import platform -from mako.lookup import TemplateLookup -from pylons.configuration import PylonsConfig -from pylons.error import handle_mako_error +import pylons +import mako.lookup +import beaker # don't remove this import it does magic for celery from kallithea.lib import celerypylons @@ -49,7 +49,7 @@ Configure the Pylons environment via the ``pylons.config`` object """ - config = PylonsConfig() + config = pylons.configuration.PylonsConfig() # Pylons paths root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -75,13 +75,12 @@ load_rcextensions(root_path=config['here']) # Setup cache object as early as possible - import pylons pylons.cache._push_object(config['pylons.app_globals'].cache) # Create the Mako TemplateLookup, with the default auto-escaping - config['pylons.app_globals'].mako_lookup = TemplateLookup( + config['pylons.app_globals'].mako_lookup = mako.lookup.TemplateLookup( directories=paths['templates'], - error_handler=handle_mako_error, + error_handler=pylons.error.handle_mako_error, module_directory=os.path.join(app_conf['cache_dir'], 'templates'), input_encoding='utf-8', default_filters=['escape'], imports=['from webhelpers.html import escape'])