|
28 | 28 | QUARTER = os.path.basename(PATHS["data_quarter"]) |
29 | 29 | SECTION_FILE = Path(__file__).name |
30 | 30 | SECTION_TITLE = "Wikipedia" |
| 31 | +LAST_ENTRY = shared.path_join( |
| 32 | + PATHS["data_phase"], "wikipedia_least_language_usage.png" |
| 33 | +) |
31 | 34 |
|
32 | 35 |
|
33 | 36 | def parse_arguments(): |
@@ -73,25 +76,6 @@ def parse_arguments(): |
73 | 76 | return args |
74 | 77 |
|
75 | 78 |
|
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 | | - |
95 | 79 | def wikipedia_intro(args): |
96 | 80 | """ |
97 | 81 | Write Wikipedia introduction. |
@@ -285,7 +269,7 @@ def main(): |
285 | 269 | args = parse_arguments() |
286 | 270 | shared.paths_log(LOGGER, PATHS) |
287 | 271 | shared.git_fetch_and_merge(args, PATHS["repo"]) |
288 | | - check_report_completion(args) |
| 272 | + shared.check_completion_file_exists(args, LAST_ENTRY) |
289 | 273 | wikipedia_intro(args) |
290 | 274 | plot_language_representation(args) |
291 | 275 | plot_highest_language_usage(args) |
|
0 commit comments