You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
795 B

7 years ago
7 years ago
7 years ago
7 years ago
  1. #/usr/bin/python
  2. def hash_file(path,hash_if_less,sample):
  3. return _imohash(path,hash_if_less,sample)
  4. def __init_database__(path):
  5. con = sqlite3.connect(path)
  6. cur = con.cursor()
  7. #cur.execute('CREATE TABLE IF NOT EXISTS `paths` (`path` TEXT, `imohash` BLOB, `blake` BLOB, UNIQUE(`path`, `imohash`, `blake`));')
  8. con.commit()
  9. class fs:
  10. def __init__(self,top,db_path=None,hash_threshold=1024**2,sample=128*1024):
  11. self.top=top
  12. self.hash_threshold=hash_threshold
  13. if db_path is not None:
  14. self.db_path=db_path
  15. else:
  16. self.db_path = 'fs.db'
  17. def from_db(self,top,db_path,_id=0):
  18. pass
  19. def write_to_db(self):
  20. pass
  21. def morph(self,other):
  22. pass
  23. def backup(self,other):
  24. pass