ProCreations's picture
Publish validated native logbook bundle
c279da6 verified
Raw
History Blame Contribute Delete
389 Bytes
#!/usr/bin/env python3
import hashlib
from pathlib import Path
r=Path(__file__).resolve().parent; o=r/'BUNDLE_SHA256SUMS.txt'; rows=[]
for p in sorted(r.rglob('*')):
if p.is_file() and p!=o and '__pycache__' not in p.parts: rows.append(f'{hashlib.sha256(p.read_bytes()).hexdigest()} {p.relative_to(r).as_posix()}')
o.write_text('\n'.join(rows)+'\n'); print(f'wrote {len(rows)} entries')