Loading other/get_md5.py +4 −3 Original line number Diff line number Diff line Loading @@ -32,11 +32,12 @@ from hashlib import md5 def get_hash_line_for_file(file: Path, experiment_dir: Path): with open(file, "b") as f: with open(file, "rb") as f: hash = md5(f.read()).hexdigest() filepath = file.relative_to(experiment_dir) hashline = f"{str(filepath)} {hash}" # always print forward slashes even on windows to be able to diff the result files hashline = f"{str(filepath.as_posix())} {hash}\n" return hashline Loading @@ -46,7 +47,7 @@ def main(experiment_dir, out_file): hashlines = [get_hash_line_for_file(f, experiment_dir) for f in wav_files] with open(out_file) as f: with open(out_file, "w") as f: f.writelines(hashlines) Loading Loading
other/get_md5.py +4 −3 Original line number Diff line number Diff line Loading @@ -32,11 +32,12 @@ from hashlib import md5 def get_hash_line_for_file(file: Path, experiment_dir: Path): with open(file, "b") as f: with open(file, "rb") as f: hash = md5(f.read()).hexdigest() filepath = file.relative_to(experiment_dir) hashline = f"{str(filepath)} {hash}" # always print forward slashes even on windows to be able to diff the result files hashline = f"{str(filepath.as_posix())} {hash}\n" return hashline Loading @@ -46,7 +47,7 @@ def main(experiment_dir, out_file): hashlines = [get_hash_line_for_file(f, experiment_dir) for f in wav_files] with open(out_file) as f: with open(out_file, "w") as f: f.writelines(hashlines) Loading