mirror of https://github.com/tLDP/python-tldp
rework tracking of success vector
This commit is contained in:
parent
1475cf7890
commit
08df7acbe2
|
@ -34,20 +34,25 @@ class BaseDoctype(object):
|
||||||
assert None not in (self.source, self.output, self.config)
|
assert None not in (self.source, self.output, self.config)
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
|
def last(l):
|
||||||
|
return l[-1]
|
||||||
self.output.prebuild_hook()
|
self.output.prebuild_hook()
|
||||||
os.chdir(self.output.dirname)
|
os.chdir(self.output.dirname)
|
||||||
vector = [self.config_check(),
|
command = list()
|
||||||
self.create_htmls(),
|
command.append(self.build_precheck())
|
||||||
self.create_pdf(),
|
if not last(command):
|
||||||
self.create_txt(),
|
return False
|
||||||
self.create_html(),
|
command.append(self.create_htmls())
|
||||||
]
|
command.append(self.create_pdf())
|
||||||
result = all(vector)
|
command.append(self.create_txt())
|
||||||
|
command.append(self.create_html())
|
||||||
|
|
||||||
|
result = all(command)
|
||||||
if result:
|
if result:
|
||||||
self.output.build_success_hook()
|
self.output.build_success_hook()
|
||||||
else:
|
else:
|
||||||
self.output.build_failure_hook()
|
self.output.build_failure_hook()
|
||||||
return all(vector)
|
return result
|
||||||
|
|
||||||
#
|
#
|
||||||
# -- end of file
|
# -- end of file
|
||||||
|
|
Loading…
Reference in New Issue