WIP: improving the table compare function

This commit is contained in:
JohnE 2016-03-02 14:04:16 -08:00
parent ff1d7ab9ac
commit 5b683cb108
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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