From 3c431019de4899e6a71cc5650ec52df65d56b2d7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 11 Dec 2016 04:35:04 -0800 Subject: update pshell with config_vars argument --- pyramid/scripts/pshell.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pyramid/scripts/pshell.py b/pyramid/scripts/pshell.py index 7fa2f04a1..d8abf6619 100644 --- a/pyramid/scripts/pshell.py +++ b/pyramid/scripts/pshell.py @@ -68,6 +68,14 @@ class PShellCommand(object): nargs='?', default=None, help='The URI to the configuration file.') + parser.add_argument( + 'config_vars', + nargs='*', + default=(), + help="Variables required by the config file. For example, " + "`http_port=%%(http_port)s` would expect `http_port=8080` to be " + "passed here.", + ) ConfigParser = configparser.ConfigParser # testing default_runner = python_shell_runner # testing @@ -120,7 +128,8 @@ class PShellCommand(object): self.pshell_file_config(config_file) # bootstrap the environ - env = self.bootstrap[0](config_uri, options=parse_vars(self.args[1:])) + env = self.bootstrap[0](config_uri, + options=parse_vars(self.args.config_vars)) # remove the closer from the env self.closer = env.pop('closer') -- cgit v1.2.3