mirror of https://github.com/tLDP/python-tldp
add a place to capture the MD5 data of the source
This commit is contained in:
parent
753774c5e9
commit
49b2ee57ae
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue