@@ -145,17 +145,17 @@ def main():
145145 print ("Starting to generate documentation..." )
146146 template_overview (output_dir , device_list , board_list , template_path )
147147 print (f"... for { len (device_list ) + len (board_list )} devices, estimated memory footprint is { len (device_list )* 70 + 2000 } MB" )
148+ # We can only pass one argument to pool.map
149+ devices = [f'python3 { filepath } --target-job "{ modm_path } |{ tempdir } |{ dev } ||{ args .deduplicate } |{ args .compress } "' for dev in device_list ]
150+ devices += [f'python3 { filepath } --target-job "{ modm_path } |{ tempdir } |{ dev } |{ brd } |{ args .deduplicate } |{ args .compress } "' for (brd , dev ) in board_list ]
151+ devices = list (set (devices ))
152+ # Run the first generation first so that the other jobs can already deduplicate properly
153+ results = [subprocess .call (devices [0 ], shell = True )]
148154 with ThreadPool (args .jobs ) as pool :
149- # We can only pass one argument to pool.map
150- devices = [f'python3 { filepath } --target-job "{ modm_path } |{ tempdir } |{ dev } ||{ args .deduplicate } |{ args .compress } "' for dev in device_list ]
151- devices += [f'python3 { filepath } --target-job "{ modm_path } |{ tempdir } |{ dev } |{ brd } |{ args .deduplicate } |{ args .compress } "' for (brd , dev ) in board_list ]
152- devices = list (set (devices ))
153- # Run the first generation first so that the other jobs can already deduplicate properly
154- results = [subprocess .call (devices [0 ], shell = True )]
155155 results += pool .map (lambda d : subprocess .call (d , shell = True ), devices [1 :])
156- # remove all the hash files
157- for file in (output_dir / "develop/api" ).glob ("*.hash" ):
158- file .unlink ()
156+ # remove all the hash files
157+ for file in (output_dir / "develop/api" ).glob ("*.hash" ):
158+ file .unlink ()
159159 if args .compress :
160160 print ("Zipping docs ..." )
161161 # Zipping is *much* faster via command line than via python!
@@ -180,7 +180,7 @@ def create_target(argument):
180180 tempdir = Path (tempdir )
181181 output_dir = board if board else device
182182 try :
183- print (f"Generating documentation for { output_dir } ..." )
183+ print (f"Generating documentation for { output_dir } ..." , flush = True )
184184
185185 options = [f"modm:target={ device } " ]
186186 if device .startswith ("at" ):
@@ -202,19 +202,19 @@ def create_target(argument):
202202
203203 builder .build (output_dir , modules )
204204
205- print (f"Executing: (cd { output_dir } /modm/docs/ && doxypress doxypress.json)" )
205+ print (f"Executing: (cd { output_dir } /modm/docs/ && doxypress doxypress.json)" , flush = True )
206206 retval = subprocess .call (f"(cd { output_dir } /modm/docs/ && doxypress doxypress.json > /dev/null 2>&1)" , shell = True )
207207 # retval = subprocess.call(f"(cd {output_dir}/modm/docs/ && doxygen doxyfile.cfg > /dev/null 2>&1)", shell=True)
208208 if retval != 0 :
209- print (f"Error { retval } generating documentation for device { output_dir } ." )
209+ print (f"Error { retval } generating documentation for device { output_dir } ." , flush = True )
210210 return False
211- print (f"Finished generating documentation for device { output_dir } ." )
211+ print (f"Finished generating documentation for device { output_dir } ." , flush = True )
212212
213213 srcdir = (tempdir / output_dir / "modm/docs/html" )
214214 destdir = tempdir / "output/develop/api" / output_dir
215215
216216 if deduplicate == "True" :
217- print (f"Deduplicating files for { device } ..." )
217+ print (f"Deduplicating files for { device } ..." , flush = True )
218218 # Find and build the hash symlink database
219219 hashdb = {}
220220 for hashes in tempdir .glob ("output/develop/api/*.hash" ):
@@ -266,7 +266,7 @@ def create_target(argument):
266266 srcdir .rename (destdir )
267267 return True
268268 except Exception as e :
269- print (f"Error generating documentation for device { output_dir } : { e } " )
269+ print (f"Error generating documentation for device { output_dir } : { e } " , flush = True )
270270 return False
271271
272272
0 commit comments