From 5b683cb1088c44cfc958806bc90f01ef42474397 Mon Sep 17 00:00:00 2001 From: JohnE Date: Wed, 2 Mar 2016 14:04:16 -0800 Subject: [PATCH] WIP: improving the table compare function --- dbfp.py | 2 +- libs/fingerprint.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dbfp.py b/dbfp.py index 7d2073a..27999fc 100644 --- a/dbfp.py +++ b/dbfp.py @@ -68,7 +68,6 @@ def compareFPIndex(fp_dir, db_in, json_in): else: db.importJson(json_in) - fp = FingerprintIndex() fp.openIndex(fp_dir) @@ -94,6 +93,7 @@ def compareFPIndex(fp_dir, db_in, json_in): except Exception as ex: print "ERROR: error occured while comparing fingerprint" print ex + # def androidPull(): fin_count = 0 diff --git a/libs/fingerprint.py b/libs/fingerprint.py index 82e011b..d14f260 100644 --- a/libs/fingerprint.py +++ b/libs/fingerprint.py @@ -198,6 +198,7 @@ class FingerprintDB: logging.info("[[ Comparing Table: " + tableName + " ]]") table = self.tables[tableName] if (table): + print "***__DBMD5Compare:: hash1=={}, hash2=={}".format(fp.tables[tableName].hash(), table.hash()) if not (fp.tables[tableName].hash() == table.hash()): logging.info("*** Hash difference 1:{}!={}".format(fp.tables[tableName].hash(), table.hash())) (total, diff_num) = self.__CompareTable(fp.tables[tableName], table) @@ -216,6 +217,8 @@ class FingerprintDB: logging.info("diff_total=={}, all_total=={}".format(diff_total, all_total)) + print "***__DBMD5Compare:: all_total=={}, diff_total=={}".format(all_total, diff_total) + if (diff_total > 0): if (diff_total == all_total): percentage = 0 @@ -253,6 +256,8 @@ class FingerprintDB: totals = prop_total_count + fields_total_count diff_total = prop_error_count + fields_diff_count + print ("***__CompareTable:: prop_total_count=={}, fields_total_count=={}, totals=={}".format(prop_total_count, fields_total_count, totals)) + print ("***__CompareTable:: prop_error_count=={}, fields_diff_count=={}, diff_total=={}".format(prop_error_count, fields_diff_count, diff_total)) return (totals, diff_total) # look at un-identified tables and try to match fields by their properties