Browse Source

filled out db_save and backup

fs_class
Raphael Roberts 7 years ago
parent
commit
ff651ac923
  1. 12
      fs_class.py

12
fs_class.py

@ -67,13 +67,23 @@ class fs:
self.id = id
def write_to_db(self):
pass
'''stores self.hash_files in database, along with a backup id and hash_func parameters'''
for hash,files in self.hash_files.item()
for file in files:
self.cur.execue('INSERT INTO paths VALUES (?,?)',[hash,file])
self.con.commit()
def morph(self,other):
'''renames/copies all files in self.top to match other'''
pass
def backup(self,other):
'''fills in self.hash_file {hash:[filepaths]}'''
paths = hashify(self.top,self.hashfunc)
for filepath,hash in paths:
self.hash_file.setdefault(hash,[]).append(filepath)
if __name__ == "__main__":
import os
test = fs(os.getcwd())
Loading…
Cancel
Save