add a place to capture the MD5 data of the source

This commit is contained in:
Martin A. Brown 2016-04-01 22:37:53 -07:00
parent 753774c5e9
commit 49b2ee57ae
1 changed files with 13 additions and 0 deletions

View File

@ -31,6 +31,10 @@ class OutputNamingConvention(object):
self.dirname = dirname
self.stem = stem
@property
def MD5SUMS(self):
return os.path.join(self.dirname, '.LDP-source-MD5SUMS')
@property
def name_txt(self):
return os.path.join(self.dirname, self.stem + '.txt')
@ -84,6 +88,15 @@ class OutputNamingConvention(object):
missing.add(name)
return missing
@property
def md5sums(self):
d = dict()
with codecs.open(self.MD5SUMS, encoding='utf-8') as f:
for line in f:
hashval, fname = line.strip().split()
d[fname] = hashval
return d
class OutputDirectory(OutputNamingConvention):
'''A class providing a container for each set of output documents