Windev — Deluxe & Certified
print(f"[Windev] Backed up: filepath → backup_path")
class WindevHandler(FileSystemEventHandler): def on_modified(self, event): if not event.is_directory: self.backup_file(event.src_path) windev
with open(LOG_FILE, 'w') as f: json.dump(log, f, indent=2) 'w') as f: json.dump(log
def log_change(self, original, backup): log = [] if os.path.exists(LOG_FILE): with open(LOG_FILE, 'r') as f: log = json.load(f) indent=2) def log_change(self
log.append( "time": self.timestamp(), "original": original, "backup": backup, "hash": hashlib.md5(open(original, 'rb').read()).hexdigest() )
You must be logged in to post a comment.