WIP: improving the table compare function
This commit is contained in:
parent
ff1d7ab9ac
commit
5b683cb108
2
dbfp.py
2
dbfp.py
|
@ -68,7 +68,6 @@ def compareFPIndex(fp_dir, db_in, json_in):
|
||||||
else:
|
else:
|
||||||
db.importJson(json_in)
|
db.importJson(json_in)
|
||||||
|
|
||||||
|
|
||||||
fp = FingerprintIndex()
|
fp = FingerprintIndex()
|
||||||
fp.openIndex(fp_dir)
|
fp.openIndex(fp_dir)
|
||||||
|
|
||||||
|
@ -94,6 +93,7 @@ def compareFPIndex(fp_dir, db_in, json_in):
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print "ERROR: error occured while comparing fingerprint"
|
print "ERROR: error occured while comparing fingerprint"
|
||||||
print ex
|
print ex
|
||||||
|
|
||||||
#
|
#
|
||||||
def androidPull():
|
def androidPull():
|
||||||
fin_count = 0
|
fin_count = 0
|
||||||
|
|
|
@ -198,6 +198,7 @@ class FingerprintDB:
|
||||||
logging.info("[[ Comparing Table: " + tableName + " ]]")
|
logging.info("[[ Comparing Table: " + tableName + " ]]")
|
||||||
table = self.tables[tableName]
|
table = self.tables[tableName]
|
||||||
if (table):
|
if (table):
|
||||||
|
print "***__DBMD5Compare:: hash1=={}, hash2=={}".format(fp.tables[tableName].hash(), table.hash())
|
||||||
if not (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()))
|
logging.info("*** Hash difference 1:{}!={}".format(fp.tables[tableName].hash(), table.hash()))
|
||||||
(total, diff_num) = self.__CompareTable(fp.tables[tableName], table)
|
(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))
|
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 > 0):
|
||||||
if (diff_total == all_total):
|
if (diff_total == all_total):
|
||||||
percentage = 0
|
percentage = 0
|
||||||
|
@ -253,6 +256,8 @@ class FingerprintDB:
|
||||||
|
|
||||||
totals = prop_total_count + fields_total_count
|
totals = prop_total_count + fields_total_count
|
||||||
diff_total = prop_error_count + fields_diff_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)
|
return (totals, diff_total)
|
||||||
|
|
||||||
# look at un-identified tables and try to match fields by their properties
|
# look at un-identified tables and try to match fields by their properties
|
||||||
|
|
Loading…
Reference in New Issue