diff --git a/scripts/3-report/gcs_report.py b/scripts/3-report/gcs_report.py index eb9130fe..0003b1cc 100755 --- a/scripts/3-report/gcs_report.py +++ b/scripts/3-report/gcs_report.py @@ -70,6 +70,13 @@ def parse_arguments(): return args +def check_report_completion(args): + last_entry = shared.path_join(PATHS["data_phase"], "gcs_free_culture.png") + if os.path.exists(last_entry) and not args.force: + LOGGER.info(f"{last_entry} already exists. Script completed") + return + + def gcs_intro(args): """ Write Google Custom Search (GCS) introduction. @@ -491,7 +498,7 @@ def main(): args = parse_arguments() shared.paths_log(LOGGER, PATHS) shared.git_fetch_and_merge(args, PATHS["repo"]) - + check_report_completion(args) gcs_intro(args) plot_products(args) plot_tool_status(args) diff --git a/scripts/3-report/github_report.py b/scripts/3-report/github_report.py index 958dcc40..5f220555 100755 --- a/scripts/3-report/github_report.py +++ b/scripts/3-report/github_report.py @@ -73,6 +73,15 @@ def parse_arguments(): return args +def check_report_completion(args): + last_entry = shared.path_join( + PATHS["data_phase"], "github_restriction.png" + ) + if os.path.exists(last_entry) and not args.force: + LOGGER.info(f"{last_entry} already exists. Script completed") + return + + def load_data(args): """ Load the collected data from the CSV file. @@ -243,6 +252,7 @@ def main(): args = parse_arguments() shared.paths_log(LOGGER, PATHS) shared.git_fetch_and_merge(args, PATHS["repo"]) + check_report_completion(args) github_intro(args) plot_totals_by_license_type(args) plot_totals_by_restriction(args) diff --git a/scripts/3-report/wikipedia_report.py b/scripts/3-report/wikipedia_report.py index 9224bcb6..44ca1e91 100755 --- a/scripts/3-report/wikipedia_report.py +++ b/scripts/3-report/wikipedia_report.py @@ -68,6 +68,15 @@ def parse_arguments(): return args +def check_report_completion(args): + last_entry = shared.path_join( + PATHS["data_phase"], "wikipedia_least_language_usage.png" + ) + if os.path.exists(last_entry) and not args.force: + LOGGER.info(f"{last_entry} already exists. Script completed") + return + + def wikipedia_intro(args): """ Write Wikipedia introduction. @@ -261,6 +270,7 @@ def main(): args = parse_arguments() shared.paths_log(LOGGER, PATHS) shared.git_fetch_and_merge(args, PATHS["repo"]) + check_report_completion(args) wikipedia_intro(args) plot_language_representation(args) plot_highest_language_usage(args)