diff --git a/scripts/add_paths.py b/scripts/add_paths.py index 9c6e11b..3627171 100644 --- a/scripts/add_paths.py +++ b/scripts/add_paths.py @@ -5,9 +5,11 @@ modified_types = set() paths_added = 0 +hints_added = 0 def update_data(data, hash_val, path_val): global paths_added + global hints_added for entry in data.values(): if entry["hash"] == hash_val: if ioi_hash(path_val) == hash_val: @@ -21,6 +23,8 @@ def update_data(data, hash_val, path_val): print(f"Hash: {hash_val} already has a path {entry['path']}. Skipping addition of hint: {path_val.lower()}.") continue else: + if "hint" not in entry or entry["hint"] == "": + hints_added += 1 entry["hint"] = path_val.lower() modified_types.add(hash_type) break @@ -45,4 +49,10 @@ def update_data(data, hash_val, path_val): if hash_type in modified_types: write_json_file(os.path.join(output_directory, f"{hash_type}.json"), data) -print(f"{paths_added} new path(s) added successfully!") +if paths_added or hints_added: + if paths_added > 0: + print(f"{paths_added} new path(s) added successfully!") + if hints_added > 0: + print(f"{hints_added} new hint(s) added successfully!") +else: + print("No new paths or hints added.") \ No newline at end of file