diff options
| author | Steve Piercy <web@stevepiercy.com> | 2016-12-11 04:35:04 -0800 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2016-12-13 17:40:20 -0800 |
| commit | 3c431019de4899e6a71cc5650ec52df65d56b2d7 (patch) | |
| tree | 2e10a4661d225d889b4b41bdb2e03748649ec093 | |
| parent | 5b40cd38daf5c1a58810a0bff364be0043bc46ba (diff) | |
| download | pyramid-3c431019de4899e6a71cc5650ec52df65d56b2d7.tar.gz pyramid-3c431019de4899e6a71cc5650ec52df65d56b2d7.tar.bz2 pyramid-3c431019de4899e6a71cc5650ec52df65d56b2d7.zip | |
update pshell with config_vars argument
| -rw-r--r-- | pyramid/scripts/pshell.py | 11 |
1 files changed, 10 insertions, 1 deletions
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') |
