From 2f0f3075b0c9a7f9d3a2b26f486d5494c4d77ee8 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Tue, 24 Apr 2018 17:40:47 -0500 Subject: [PATCH] allow web2py.py -S c/a/f?x=y --- gluon/packages/dal | 2 +- gluon/shell.py | 7 ++++--- gluon/widget.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gluon/packages/dal b/gluon/packages/dal index 6e9b8794..b7677e52 160000 --- a/gluon/packages/dal +++ b/gluon/packages/dal @@ -1 +1 @@ -Subproject commit 6e9b87943bb5162b51d085904845558a1b690812 +Subproject commit b7677e52e86955d7851dba5a162fd27b13678f9f diff --git a/gluon/shell.py b/gluon/shell.py index 2ba24dd5..63167fad 100644 --- a/gluon/shell.py +++ b/gluon/shell.py @@ -148,7 +148,7 @@ def env( request.env.web2py_runtime_gae = global_settings.web2py_runtime_gae for k, v in extra_request.items(): - request[k] = v + setattr(request, k, v) path_info = '/%s/%s/%s' % (a, c, f) if request.args: @@ -210,7 +210,7 @@ def run( - a/c : exec the controller c into the application environment """ - (a, c, f, args, vars) = parse_path_info(appname, av=True) + (a, c, f, args, vars) = parse_path_info(appname, av=True) errmsg = 'invalid application name: %s' % appname if not a: die(errmsg) @@ -246,7 +246,8 @@ def run( if args: extra_request['args'] = args if vars: - extra_request['vars'] = vars + # underscore necessary because request.vars is a property + extra_request['_vars'] = vars _env = env(a, c=c, f=f, import_models=import_models, extra_request=extra_request) if c: pyfile = os.path.join('applications', a, 'controllers', c + '.py') diff --git a/gluon/widget.py b/gluon/widget.py index 20b602bb..fbd522ae 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -766,7 +766,7 @@ def console(): msg = ('run web2py in interactive shell or IPython (if installed) with ' 'specified appname (if app does not exist it will be created). ' - 'APPNAME like a/c/f (c,f optional)') + 'APPNAME like a/c/f?x=y (c,f and vars x,y optional)') parser.add_option('-S', '--shell', dest='shell',