|
a/Allura/allura/config/middleware.py |
|
b/Allura/allura/config/middleware.py |
1 |
# -*- coding: utf-8 -*-
|
1 |
# -*- coding: utf-8 -*-
|
2 |
"""WSGI middleware initialization for the allura application."""
|
2 |
"""WSGI middleware initialization for the allura application."""
|
3 |
import mimetypes
|
3 |
import mimetypes
|
4 |
|
4 |
|
5 |
import pylons
|
|
|
6 |
import pylons.middleware
|
5 |
import pylons.middleware
|
7 |
import tg
|
6 |
import tg
|
8 |
import tg.error
|
7 |
import tg.error
|
9 |
pylons.c = pylons.tmpl_context
|
|
|
10 |
pylons.g = pylons.app_globals
|
|
|
11 |
import pkg_resources
|
8 |
import pkg_resources
|
12 |
from tg import config
|
9 |
from tg import config
|
13 |
from paste.deploy.converters import asbool
|
10 |
from paste.deploy.converters import asbool
|
14 |
from paste.registry import RegistryManager
|
11 |
from paste.registry import RegistryManager
|
15 |
from beaker.middleware import SessionMiddleware
|
12 |
from beaker.middleware import SessionMiddleware
|
|
... |
|
... |
169 |
|
166 |
|
170 |
def get_tg_vars(context):
|
167 |
def get_tg_vars(context):
|
171 |
import pylons, tg
|
168 |
import pylons, tg
|
172 |
from allura.lib import helpers as h
|
169 |
from allura.lib import helpers as h
|
173 |
from urllib import quote, quote_plus
|
170 |
from urllib import quote, quote_plus
|
174 |
context.setdefault('g', pylons.g)
|
171 |
context.setdefault('g', pylons.app_globals)
|
175 |
context.setdefault('c', pylons.c)
|
172 |
context.setdefault('c', pylons.tmpl_context)
|
176 |
context.setdefault('h', h)
|
173 |
context.setdefault('h', h)
|
177 |
context.setdefault('request', pylons.request)
|
174 |
context.setdefault('request', pylons.request)
|
178 |
context.setdefault('response', pylons.response)
|
175 |
context.setdefault('response', pylons.response)
|
179 |
context.setdefault('url', pylons.url)
|
176 |
context.setdefault('url', pylons.url)
|
180 |
context.setdefault('tg', dict(
|
177 |
context.setdefault('tg', dict(
|