5050class LauncherTools (BaseModel ):
5151 module : str = "." .join (__name__ .split ("." )[:- 1 ])
5252 tools : list [str ]
53- visualization_config_path : Optional [str ] = None
53+ tools_config : Optional [dict ] = None
5454 launchers : Optional [ILauncher ] = []
5555
5656 def run (self , consumer ):
5757 for tool in self .tools :
5858 module = tools [tool ]
59- launcher = self .launch_module (module , consumer )
59+ launcher = self .launch_module (tool , module , consumer )
6060 self .launchers .append (launcher )
6161
6262 def terminate (self ):
@@ -66,7 +66,7 @@ def terminate(self):
6666 launcher .terminate ()
6767 self .launchers = []
6868
69- def launch_module (self , configuration , consumer ):
69+ def launch_module (self , name , configuration , consumer ):
7070 def process_terminated (name , exit_code ):
7171 LogManager .logger .info (
7272 f"LauncherEngine: { name } exited with code { exit_code } "
@@ -81,8 +81,12 @@ def process_terminated(name, exit_code):
8181 launcher_module_name = configuration ["module" ]
8282 launcher_module = f"{ self .module } .launcher_{ launcher_module_name } .Launcher{ class_from_module (launcher_module_name )} "
8383 launcher_class = get_class (launcher_module )
84+ config = None
85+ if self .tools_config is not None and name in self .tools_config :
86+ config = self .tools_config [name ]
87+
8488 launcher = launcher_class .from_config (launcher_class , configuration )
85- launcher .run (self . visualization_config_path , process_terminated )
89+ launcher .run (config , process_terminated )
8690 return launcher
8791
8892 def pause (self ):
0 commit comments