51 lines
856 B
Python
51 lines
856 B
Python
#
|
|
#
|
|
# [ md5_all, md5_list, file_name ]
|
|
#
|
|
#
|
|
import logging
|
|
import sqlite3 as sql
|
|
from libs import fingerprint
|
|
|
|
|
|
class FingerprintIndex:
|
|
"""
|
|
Create and use an index to
|
|
"""
|
|
|
|
#
|
|
def __init__(self):
|
|
return
|
|
|
|
def openIndex(self):
|
|
pass
|
|
|
|
def createIndex(self):
|
|
try:
|
|
conn = sql.connect('test123.db')
|
|
conn.execute('''
|
|
CREATE TABLE md5_index (
|
|
md5_all TEXT PRIMARY KEY,
|
|
md5_list TEXT,
|
|
file_name TEXT);
|
|
''')
|
|
logging.info("Successfully created index table")
|
|
except:
|
|
logging.error("Error creating index table")
|
|
finally:
|
|
if conn:
|
|
conn.close()
|
|
|
|
def checkIntegrity(self):
|
|
""" Sanity check the number of files against the index rows """
|
|
pass
|
|
|
|
#
|
|
def dirCompare(self, folder):
|
|
pass
|
|
|
|
|
|
def compareFingerprint(self, fp1, fp2):
|
|
pass
|
|
|