@@ -307,7 +307,7 @@ def generate_plot_data(
307307
308308
309309def generate_singlepage_data (page_blocks , full_data ,
310- input_path = None , output_path = None ):
310+ input_path_default = None , output_path = None ):
311311 data_function_map = {
312312 "dashboard" : generate_dashboard_data ,
313313 "table" : generate_table_data ,
@@ -319,7 +319,7 @@ def generate_singlepage_data(page_blocks, full_data,
319319 if block ["type" ] == "generic" :
320320 continue
321321 input_path = Path (block ["args" ]["data_args" ]
322- .get ("input_path" , input_path ))
322+ .get ("input_path" , input_path_default ))
323323 if input_path is not None and output_path is not None :
324324 input_path = input_path .expanduser ()
325325 update_needed = check_update (
@@ -344,7 +344,7 @@ def generate_singlepage_data(page_blocks, full_data,
344344
345345
346346def generate_daily_data (
347- page_blocks , full_data , input_path , output_path ,
347+ page_blocks , full_data , input_path_default , output_path ,
348348 filename_template , file_grouper ,
349349 output_args = None , ** table_process_args ):
350350 if output_args is None :
@@ -354,7 +354,7 @@ def generate_daily_data(
354354 if page_blocks [section_id ]["type" ] == "generic" :
355355 continue
356356 update_needed = check_update (
357- input_path ,
357+ input_path_default ,
358358 output_path / (LASTUPDATE_FILENAME .format (section_id = section_id )))
359359 if not update_needed :
360360 continue
@@ -377,7 +377,7 @@ def generate_daily_data(
377377
378378def generate_site_data (content_pages , project_path = None ):
379379 full_data = sindri .process .ingest_status_data (n_days = None )
380- input_path = sindri .process .get_status_data_paths (n_days = 1 )[0 ]
380+ input_path_default = sindri .process .get_status_data_paths (n_days = 1 )[0 ]
381381 if project_path :
382382 project_path = Path (project_path ) / ASSET_PATH
383383 else :
@@ -388,14 +388,16 @@ def generate_site_data(content_pages, project_path=None):
388388 os .makedirs (output_path , exist_ok = True )
389389 if page ["type" ] is None :
390390 continue
391- elif page ["type" ] == "singlepage" :
392- generate_singlepage_data (
393- page_blocks = page ["blocks" ], full_data = full_data ,
394- input_path = input_path , output_path = output_path )
391+ common_args = {
392+ "page_blocks" : page ["blocks" ],
393+ "full_data" : full_data ,
394+ "input_path_default" : input_path_default ,
395+ "output_path" : output_path ,
396+ }
397+ if page ["type" ] == "singlepage" :
398+ generate_singlepage_data (** common_args )
395399 elif page ["type" ] == "daily" :
396- generate_daily_data (
397- page_blocks = page ["blocks" ], full_data = full_data ,
398- input_path = input_path , output_path = output_path , ** page ["args" ])
400+ generate_daily_data (** common_args , ** page ["args" ])
399401 else :
400402 raise ValueError (
401403 "Page type must be one of {None, 'singlepage', 'daily'}, "
0 commit comments