@@ -23,6 +23,11 @@ def base_cmd(bids_dir: Path, output_dir: Path) -> str:
2323 return cmd
2424
2525
26+ def append_main_cmd (cmd : str , analysis_level : str , action : str ) -> str :
27+ cmd += f"{ new_line } '{ analysis_level } '{ new_line } 'action', '{ action } '"
28+ return cmd
29+
30+
2631def end_cmd (cmd : str ) -> str :
2732 cmd += "); exit;"
2833 return cmd
@@ -95,7 +100,7 @@ def default_model(
95100 return 1
96101
97102 cmd = base_cmd (bids_dir = bids_dir , output_dir = output_dir )
98- cmd += f" { new_line } 'dataset' { new_line } 'action', ' default_model'"
103+ cmd = append_main_cmd ( cmd = cmd , analysis_level = analysis_level , action = " default_model" )
99104 cmd = append_base_arguments (
100105 cmd = cmd , verbosity = verbosity , space = space , task = task , ignore = ignore
101106 )
@@ -129,7 +134,7 @@ def preprocess(
129134 return 1
130135
131136 cmd = base_cmd (bids_dir = bids_dir , output_dir = output_dir )
132- cmd += f" { new_line } ' subject' { new_line } 'action', ' preprocess'"
137+ cmd = append_main_cmd ( cmd = cmd , analysis_level = " subject" , action = " preprocess" )
133138 cmd = append_base_arguments (
134139 cmd = cmd , verbosity = verbosity , space = space , task = task , ignore = ignore
135140 )
@@ -180,7 +185,7 @@ def stats(
180185 return 1
181186
182187 cmd = base_cmd (bids_dir = bids_dir , output_dir = output_dir )
183- cmd += f" { new_line } ' subject' { new_line } 'action', ' { action } '"
188+ cmd = append_main_cmd ( cmd = cmd , analysis_level = " subject" , action = action )
184189 cmd = append_base_arguments (
185190 cmd = cmd , verbosity = verbosity , space = space , task = task , ignore = ignore
186191 )
0 commit comments