@@ -34,6 +34,7 @@ def parse_arguments():
3434 """
3535 Parses command-line arguments, returns parsed arguments.
3636 """
37+ global QUARTER
3738 LOGGER .info ("Parsing command-line arguments" )
3839 parser = argparse .ArgumentParser (description = __doc__ )
3940 parser .add_argument (
@@ -68,30 +69,12 @@ def parse_arguments():
6869 if args .quarter != QUARTER :
6970 global PATHS
7071 PATHS = shared .paths_update (LOGGER , PATHS , QUARTER , args .quarter )
72+ QUARTER = args .quarter
7173 args .logger = LOGGER
7274 args .paths = PATHS
7375 return args
7476
7577
76- def check_report_completion (args ):
77- """ "
78- The function checks for the last plot and image
79- caption created in this script. This helps to
80- immediately know if all plots in the script have
81- been created and should not be regenerated.
82-
83- """
84- if args .force :
85- return
86- last_entry = shared .path_join (
87- PATHS ["data_phase" ], "wikipedia_least_language_usage.png"
88- )
89- if os .path .exists (last_entry ):
90- raise shared .QuantifyingException (
91- f"{ last_entry } already exists. Report script completed" , 0
92- )
93-
94-
9578def wikipedia_intro (args ):
9679 """
9780 Write Wikipedia introduction.
@@ -285,7 +268,10 @@ def main():
285268 args = parse_arguments ()
286269 shared .paths_log (LOGGER , PATHS )
287270 shared .git_fetch_and_merge (args , PATHS ["repo" ])
288- check_report_completion (args )
271+ last_entry = shared .path_join (
272+ PATHS ["data_phase" ], "wikipedia_least_language_usage.png"
273+ )
274+ shared .check_completion_file_exists (args , last_entry )
289275 wikipedia_intro (args )
290276 plot_language_representation (args )
291277 plot_highest_language_usage (args )
0 commit comments