diff options
| author | Steve Piercy <web@stevepiercy.com> | 2016-12-10 05:08:32 -0800 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2016-12-13 17:39:00 -0800 |
| commit | 9de2cd1d05ff62e3f75930559c2d83553df45d80 (patch) | |
| tree | 2b64fe526b8477c40491521f0c7909da0a432ca5 | |
| parent | 0be0f1028ff8f996147ab275a403d6b99e43b932 (diff) | |
| download | pyramid-9de2cd1d05ff62e3f75930559c2d83553df45d80.tar.gz pyramid-9de2cd1d05ff62e3f75930559c2d83553df45d80.tar.bz2 pyramid-9de2cd1d05ff62e3f75930559c2d83553df45d80.zip | |
fix pserve to allow 4 of 5 tests to pass
| -rw-r--r-- | pyramid/scripts/pserve.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index f3515804d..50f4ac1d2 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -100,8 +100,18 @@ class PServeCommand(object): help="Suppress verbose output") parser.add_argument( 'config_uri', + nargs='?', + default=None, help='The URI to the configuration file.', ) + parser.add_argument( + 'config_args', + nargs='*', + default=(), + help='Arbitrary options to override those in the [app:main] section ' + 'of the configuration file.', + ) + ConfigParser = configparser.ConfigParser # testing loadapp = staticmethod(loadapp) # testing @@ -120,7 +130,7 @@ class PServeCommand(object): print(msg) def get_options(self): - restvars = self.args[1:] + restvars = self.args.config_args return parse_vars(restvars) def pserve_file_config(self, filename, global_conf=None): @@ -150,10 +160,10 @@ class PServeCommand(object): self.watch_files.append(os.path.abspath(file)) def run(self): # pragma: no cover - if not self.args: + if not self.args.config_uri: self.out('You must give a config file') return 2 - app_spec = self.args[0] + app_spec = self.args.config_uri vars = self.get_options() app_name = self.args.app_name |
