reverted changes to html.py
This commit is contained in:
+8
-8
@@ -274,27 +274,27 @@ def URL(
|
|||||||
if not isinstance(args, (list, tuple)):
|
if not isinstance(args, (list, tuple)):
|
||||||
args = [args]
|
args = [args]
|
||||||
|
|
||||||
if r is None:
|
if not r:
|
||||||
if a is not None and c is None and f is None:
|
if a and not c and not f:
|
||||||
(f, a, c) = (a, c, f)
|
(f, a, c) = (a, c, f)
|
||||||
elif a is not None and c is not None and f is None:
|
elif a and c and not f:
|
||||||
(c, f, a) = (a, c, f)
|
(c, f, a) = (a, c, f)
|
||||||
from globals import current
|
from globals import current
|
||||||
if hasattr(current, 'request'):
|
if hasattr(current, 'request'):
|
||||||
r = current.request
|
r = current.request
|
||||||
|
|
||||||
if r is not None:
|
if r:
|
||||||
application = r.application
|
application = r.application
|
||||||
controller = r.controller
|
controller = r.controller
|
||||||
function = r.function
|
function = r.function
|
||||||
env = r.env
|
env = r.env
|
||||||
if extension is None and r.extension != 'html':
|
if extension is None and r.extension != 'html':
|
||||||
extension = r.extension
|
extension = r.extension
|
||||||
if a is not None:
|
if a:
|
||||||
application = a
|
application = a
|
||||||
if c is not None:
|
if c:
|
||||||
controller = c
|
controller = c
|
||||||
if f is not None:
|
if f:
|
||||||
if not isinstance(f, str):
|
if not isinstance(f, str):
|
||||||
if hasattr(f, '__name__'):
|
if hasattr(f, '__name__'):
|
||||||
function = f.__name__
|
function = f.__name__
|
||||||
@@ -326,7 +326,7 @@ def URL(
|
|||||||
|
|
||||||
function2 = '%s.%s' % (function, extension or 'html')
|
function2 = '%s.%s' % (function, extension or 'html')
|
||||||
|
|
||||||
if not (application and controller and function is not None):
|
if not (application and controller and function):
|
||||||
raise SyntaxError('not enough information to build the url (%s %s %s)' % (application, controller, function))
|
raise SyntaxError('not enough information to build the url (%s %s %s)' % (application, controller, function))
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
|
|||||||
Reference in New Issue
Block a user