delver/check_md5sum_data.py

18 lines
485 B
Python
Raw Normal View History

2022-09-14 16:43:59 +03:00
import os
import hashlib
from glob import glob
from pathlib import Path
import json
if __name__ == '__main__':
data_sums = json.loads(Path('dataSums.json').read_text())
data_sums_new = json.loads(Path('dataSums.new.json').read_text())
for file in data_sums:
try:
if (data_sums[file] != data_sums_new[file]):
print('{file} updated.'.format(file=file))
except KeyError as e:
print('{file} added.'.format(file=file))