From ac4a2c8ea137a32ff453dbeed3affa4b19a3c581 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Mon, 27 Feb 2012 16:58:01 -0600 Subject: [PATCH] oup/web2py/browse_thread/thread/5221c4a0e28640f8#, thanks Anthony --- VERSION | 2 +- gluon/html.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 231bc9a6..ce69e1a9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.4 (2012-02-27 08:52:23) stable +Version 1.99.4 (2012-02-27 16:57:41) stable diff --git a/gluon/html.py b/gluon/html.py index b3539161..abcf72df 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -233,6 +233,9 @@ def URL( controller = None function = None + if not isinstance(args, (list, tuple)): + args = [args] + if not r: if a and not c and not f: (f,a,c)=(a,c,f) elif a and c and not f: (c,f,a)=(a,c,f) @@ -256,19 +259,20 @@ def URL( function = f.__name__ else: raise SyntaxError, 'when calling URL, function or function name required' - elif '.' in f: - function, extension = f.split('.', 1) + elif '/' in f: + items = f.split('/') + function = f = items[0] + args = items[1:] + args else: function = f + if '.' in function: + function, extension = function.split('.', 1) function2 = '%s.%s' % (function,extension or 'html') if not (application and controller and function): raise SyntaxError, 'not enough information to build the url' - if not isinstance(args, (list, tuple)): - args = [args] - if args: if url_encode: if encode_embedded_slash: