@@ -290,6 +290,9 @@ def create_parser(product_choices=None):
290
290
config_group .add_argument ("--no-suppress-handler-traceback" , action = "store_false" ,
291
291
dest = "supress_handler_traceback" ,
292
292
help = "Write the stacktrace for exceptions in server handlers" )
293
+ config_group .add_argument ("--ws-extra" , action = "append" , default = None ,
294
+ dest = "ws_extra" ,
295
+ help = "Extra paths containing websockets handlers" )
293
296
294
297
build_type = parser .add_mutually_exclusive_group ()
295
298
build_type .add_argument ("--debug-build" , dest = "debug" , action = "store_true" ,
@@ -469,24 +472,31 @@ def set_from_config(kwargs):
469
472
470
473
kwargs ["product" ] = products .Product (kwargs ["config" ], kwargs ["product" ])
471
474
472
- keys = {"paths" : [("prefs" , "prefs_root" , True ),
473
- ("run_info" , "run_info" , True )],
474
- "web-platform-tests" : [("remote_url" , "remote_url" , False ),
475
- ("branch" , "branch" , False ),
476
- ("sync_path" , "sync_path" , True )],
477
- "SSL" : [("openssl_binary" , "openssl_binary" , True ),
478
- ("certutil_binary" , "certutil_binary" , True ),
479
- ("ca_cert_path" , "ca_cert_path" , True ),
480
- ("host_cert_path" , "host_cert_path" , True ),
481
- ("host_key_path" , "host_key_path" , True )]}
475
+ keys = {"paths" : [("prefs" , "prefs_root" , "path" ),
476
+ ("run_info" , "run_info" , "path" ),
477
+ ("ws_extra" , "ws_extra" , "paths" )],
478
+ "web-platform-tests" : [("remote_url" , "remote_url" , "str" ),
479
+ ("branch" , "branch" , "str" ),
480
+ ("sync_path" , "sync_path" , "path" )],
481
+ "SSL" : [("openssl_binary" , "openssl_binary" , "path" ),
482
+ ("certutil_binary" , "certutil_binary" , "path" ),
483
+ ("ca_cert_path" , "ca_cert_path" , "path" ),
484
+ ("host_cert_path" , "host_cert_path" , "path" ),
485
+ ("host_key_path" , "host_key_path" , "path" )]}
486
+
487
+ getters = {
488
+ "str" : "get" ,
489
+ "path" : "get_path" ,
490
+ "paths" : "get_paths"
491
+ }
482
492
483
493
for section , values in keys .items ():
484
- for config_value , kw_value , is_path in values :
494
+ for config_value , kw_value , prop_type in values :
495
+ if prop_type not in getters :
496
+ raise ValueError (f"Unknown config property type { prop_type } " )
497
+ getter_name = getters [prop_type ]
485
498
if kw_value in kwargs and kwargs [kw_value ] is None :
486
- if not is_path :
487
- new_value = kwargs ["config" ].get (section , config .ConfigDict ({})).get (config_value )
488
- else :
489
- new_value = kwargs ["config" ].get (section , config .ConfigDict ({})).get_path (config_value )
499
+ new_value = getattr (kwargs ["config" ].get (section , config .ConfigDict ({})), getter_name )(config_value )
490
500
kwargs [kw_value ] = new_value
491
501
492
502
test_paths = get_test_paths (kwargs ["config" ],
0 commit comments