Skip to content

Commit 3355e03

Browse files
committed
checks for last entry in the report script
1 parent dceb663 commit 3355e03

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

scripts/3-report/gcs_report.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ def parse_arguments():
7070
return args
7171

7272

73+
def check_report_completion(args):
74+
last_entry = shared.path_join(PATHS["data_phase"], "gcs_free_culture.png")
75+
if os.path.exists(last_entry) and not args.force:
76+
LOGGER.info(f"{last_entry} already exists. Script completed")
77+
return
78+
79+
7380
def gcs_intro(args):
7481
"""
7582
Write Google Custom Search (GCS) introduction.
@@ -491,7 +498,7 @@ def main():
491498
args = parse_arguments()
492499
shared.paths_log(LOGGER, PATHS)
493500
shared.git_fetch_and_merge(args, PATHS["repo"])
494-
501+
check_report_completion(args)
495502
gcs_intro(args)
496503
plot_products(args)
497504
plot_tool_status(args)

scripts/3-report/github_report.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ def parse_arguments():
7373
return args
7474

7575

76+
def check_report_completion(args):
77+
last_entry = shared.path_join(
78+
PATHS["data_phase"], "github_restriction.png"
79+
)
80+
if os.path.exists(last_entry) and not args.force:
81+
LOGGER.info(f"{last_entry} already exists. Script completed")
82+
return
83+
84+
7685
def load_data(args):
7786
"""
7887
Load the collected data from the CSV file.
@@ -243,6 +252,7 @@ def main():
243252
args = parse_arguments()
244253
shared.paths_log(LOGGER, PATHS)
245254
shared.git_fetch_and_merge(args, PATHS["repo"])
255+
check_report_completion(args)
246256
github_intro(args)
247257
plot_totals_by_license_type(args)
248258
plot_totals_by_restriction(args)

scripts/3-report/wikipedia_report.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ def parse_arguments():
6868
return args
6969

7070

71+
def check_report_completion(args):
72+
last_entry = shared.path_join(
73+
PATHS["data_phase"], "wikipedia_least_language_usage.png"
74+
)
75+
if os.path.exists(last_entry) and not args.force:
76+
LOGGER.info(f"{last_entry} already exists. Script completed")
77+
return
78+
79+
7180
def wikipedia_intro(args):
7281
"""
7382
Write Wikipedia introduction.
@@ -261,6 +270,7 @@ def main():
261270
args = parse_arguments()
262271
shared.paths_log(LOGGER, PATHS)
263272
shared.git_fetch_and_merge(args, PATHS["repo"])
273+
check_report_completion(args)
264274
wikipedia_intro(args)
265275
plot_language_representation(args)
266276
plot_highest_language_usage(args)

0 commit comments

Comments
 (0)