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.dirname = dirname
|
||||||
self.stem = stem
|
self.stem = stem
|
||||||
|
|
||||||
|
@property
|
||||||
|
def MD5SUMS(self):
|
||||||
|
return os.path.join(self.dirname, '.LDP-source-MD5SUMS')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name_txt(self):
|
def name_txt(self):
|
||||||
return os.path.join(self.dirname, self.stem + '.txt')
|
return os.path.join(self.dirname, self.stem + '.txt')
|
||||||
|
@ -84,6 +88,15 @@ class OutputNamingConvention(object):
|
||||||
missing.add(name)
|
missing.add(name)
|
||||||
return missing
|
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):
|
class OutputDirectory(OutputNamingConvention):
|
||||||
'''A class providing a container for each set of output documents
|
'''A class providing a container for each set of output documents
|
||||||
|
|
Loading…
Reference in New Issue