fixed grid layout again

This commit is contained in:
mdipierro
2012-09-13 14:06:58 -05:00
parent 59d9645f33
commit 8f267a19c4
9 changed files with 87 additions and 45 deletions
+12 -6
View File
@@ -162,10 +162,12 @@ def url_in(request, environ):
return map_url_in(request, environ)
return regex_url_in(request, environ)
def url_out(request, env, application, controller, function, args, other, scheme, host, port):
def url_out(request, env, application, controller, function,
args, other, scheme, host, port):
"assemble and rewrite outgoing URL"
if routers:
acf = map_url_out(request, env, application, controller, function, args, other, scheme, host, port)
acf = map_url_out(request, env, application, controller,
function, args, other, scheme, host, port)
url = '%s%s' % (acf, other)
else:
url = '/%s/%s/%s%s' % (application, controller, function, other)
@@ -226,7 +228,8 @@ def try_rewrite_on_error(http_response, request, environ, ticket=None):
# Rewrite routes_onerror path.
path_info = '/' + path_info.lstrip('/') # add leading '/' if missing
environ['PATH_INFO'] = path_info
error_handling_path = url_in(request, environ)[1]['PATH_INFO']
error_handling_path = \
url_in(request, environ)[1]['PATH_INFO']
# Avoid infinite loop.
if error_handling_path != error_raising_path:
# wsgibase will be called recursively with the routes_onerror path.
@@ -1122,7 +1125,8 @@ class MapUrlIn(object):
class MapUrlOut(object):
"logic for mapping outgoing URLs"
def __init__(self, request, env, application, controller, function, args, other, scheme, host, port):
def __init__(self, request, env, application, controller,
function, args, other, scheme, host, port):
"initialize a map-out object"
self.default_application = routers.BASE.default_application
if application in routers:
@@ -1323,7 +1327,8 @@ def map_url_in(request, env, app=False):
map.update_request()
return (None, map.env)
def map_url_out(request, env, application, controller, function, args, other, scheme, host, port):
def map_url_out(request, env, application, controller,
function, args, other, scheme, host, port):
'''
supply /a/c/f (or /a/lang/c/f) portion of outgoing url
@@ -1349,7 +1354,8 @@ def map_url_out(request, env, application, controller, function, args, other, sc
We assume that language names do not collide with a/c/f names.
'''
map = MapUrlOut(request, env, application, controller, function, args, other, scheme, host, port)
map = MapUrlOut(request, env, application, controller,
function, args, other, scheme, host, port)
return map.acf()
def get_effective_router(appname):