Skip to content

Instantly share code, notes, and snippets.

@kieranjol
Last active January 14, 2019 11:10
Show Gist options
  • Save kieranjol/266157baf875bb4ad8130ffd393cdff3 to your computer and use it in GitHub Desktop.
Save kieranjol/266157baf875bb4ad8130ffd393cdff3 to your computer and use it in GitHub Desktop.
import sys
import os
source = sys.argv[1]
with open(source, 'r') as fo:
lines = fo.readlines()
for index, line in enumerate(lines):
if 'Source Checksums' in line:
if 'N/A' not in line:
checksum = line[-34:].rsplit()[0]
folder = lines[index +1 ].split()[-1].split('\\')[-2].replace('\n', '')
filename = lines[index +1 ].split()[-1].split('\\')[-1].replace('\n', '')
print '%s %s' % (checksum, os.path.join(folder, filename))
@raecasey
Copy link

raecasey commented Jan 7, 2019

I tested this out a bit last week.
the new manifest created is missing two characters at the front of every hash. So 30 characters instead of 32 and always the first 2. From spot-checking by eye the rest of the 30 character hashes match up to the 32 character hashes that i created when the material arrived.
I cant see myself what would need to be corrected in the script here. Can you take a look?
cheers

@kieranjol
Copy link
Author

Hey, so this is probably line 11 I'd imagine - but i'd need to test it out properly to figure it out. silly error.

@kieranjol
Copy link
Author

Yup, twas line 11, i changed it from 32 to 34.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment