Skip to content

Commit

Permalink
Merge branch 'master' into copyit
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranjol authored Jul 12, 2017
2 parents b8c3e9d + 388d9c3 commit eba9a5c
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 210 deletions.
31 changes: 15 additions & 16 deletions as11fixity.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import hashlib
import time
from time import sleep
import unidecode
import codecs

#1

Expand Down Expand Up @@ -104,6 +106,11 @@ def digest_with_progress(filename, chunk_size):
print 'No XML file exists.'
#8.3

print "Generating md5 for ", filename

#print digest_with_progress(full_path, 1024)
mxf_checksum = str(digest_with_progress(full_path, 1024))


dpp_xml_parse = etree.parse(full_xml_path)
dpp_xml_namespace = dpp_xml_parse.xpath('namespace-uri(.)')
Expand All @@ -114,24 +121,16 @@ def digest_with_progress(filename, chunk_size):
ep_num = dpp_xml_parse.findtext('//ns:EpisodeTitleNumber', namespaces={'ns':dpp_xml_namespace })
checksum = dpp_xml_parse.findtext('//ns:MediaChecksumValue', namespaces={'ns':dpp_xml_namespace })
#12



print "Generating md5 for ", filename

#print digest_with_progress(full_path, 1024)
mxf_checksum = str(digest_with_progress(full_path, 1024))
#13
print 'Generating Report.... \n',




if mxf_checksum == checksum:
append_csv(csv_report,(filename, series_title, prog_title, ep_num, checksum, mxf_checksum, 'CHECKSUM MATCHES!'))
else:
append_csv(csv_report,(filename, series_title, prog_title, ep_num, checksum, mxf_checksum, 'CHECKSUM DOES NOT MATCH!'))
#14
print 'Generating Report.... \n'

if mxf_checksum == checksum:           
append_csv(csv_report,(filename, unidecode.unidecode(series_title), unidecode.unidecode(prog_title), unidecode.unidecode(ep_num), checksum, mxf_checksum, 'CHECKSUM MATCHES!'))       
else:           
append_csv(csv_report,(filename, unidecode.unidecode(series_title), unidecode.unidecode(prog_title), unidecode.unidecode(ep_num), checksum, mxf_checksum, 'CHECKSUM DOES NOT MATCH!'))         #14



print "Report complete - Time elaspsed : ", datetime.now() - startTime

Expand Down
Loading

0 comments on commit eba9a5c

Please sign in to comment.