allow web2py.py -S c/a/f?x=y
This commit is contained in:
+1
-1
Submodule gluon/packages/dal updated: 6e9b87943b...b7677e52e8
+4
-3
@@ -148,7 +148,7 @@ def env(
|
|||||||
request.env.web2py_runtime_gae = global_settings.web2py_runtime_gae
|
request.env.web2py_runtime_gae = global_settings.web2py_runtime_gae
|
||||||
|
|
||||||
for k, v in extra_request.items():
|
for k, v in extra_request.items():
|
||||||
request[k] = v
|
setattr(request, k, v)
|
||||||
|
|
||||||
path_info = '/%s/%s/%s' % (a, c, f)
|
path_info = '/%s/%s/%s' % (a, c, f)
|
||||||
if request.args:
|
if request.args:
|
||||||
@@ -210,7 +210,7 @@ def run(
|
|||||||
- a/c : exec the controller c into the application environment
|
- 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
|
errmsg = 'invalid application name: %s' % appname
|
||||||
if not a:
|
if not a:
|
||||||
die(errmsg)
|
die(errmsg)
|
||||||
@@ -246,7 +246,8 @@ def run(
|
|||||||
if args:
|
if args:
|
||||||
extra_request['args'] = args
|
extra_request['args'] = args
|
||||||
if vars:
|
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)
|
_env = env(a, c=c, f=f, import_models=import_models, extra_request=extra_request)
|
||||||
if c:
|
if c:
|
||||||
pyfile = os.path.join('applications', a, 'controllers', c + '.py')
|
pyfile = os.path.join('applications', a, 'controllers', c + '.py')
|
||||||
|
|||||||
+1
-1
@@ -766,7 +766,7 @@ def console():
|
|||||||
|
|
||||||
msg = ('run web2py in interactive shell or IPython (if installed) with '
|
msg = ('run web2py in interactive shell or IPython (if installed) with '
|
||||||
'specified appname (if app does not exist it will be created). '
|
'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',
|
parser.add_option('-S',
|
||||||
'--shell',
|
'--shell',
|
||||||
dest='shell',
|
dest='shell',
|
||||||
|
|||||||
Reference in New Issue
Block a user