From 0efa05b39f161588b05853bb548fb7bd1a7fd453 Mon Sep 17 00:00:00 2001 From: giles knap Date: Sun, 15 Dec 2024 21:15:38 +0000 Subject: [PATCH] add summary in db-compare --- src/builder2ibek/dbcompare.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/builder2ibek/dbcompare.py b/src/builder2ibek/dbcompare.py index dab2acd..6079bf4 100644 --- a/src/builder2ibek/dbcompare.py +++ b/src/builder2ibek/dbcompare.py @@ -21,9 +21,16 @@ def compare_dbs(original: Path, new: Path): for record in regex_record.finditer(new_text): new_set.add(f"{record.group(1)} {record.group(2)}") - print("*******************************************************************") + old_only = sorted(old_set - new_set) + new_only = sorted(new_set - old_set) + print("\n*****************************************************************") print("Records in original but not in new:") - print("\n".join(sorted(old_set - new_set))) - print("*******************************************************************") + print("\n".join(old_only)) + print("\n*****************************************************************") print("Records in new but not in original:") - print("\n".join(sorted(new_set - old_set))) + print("\n".join(new_only)) + print("\n*****************************************************************") + print(" records in original: ", len(old_set)) + print(" records in new: ", len(new_set)) + print(" records missing in new: ", len(old_only)) + print(" records extra in new: ", len(new_only))