mirror of https://github.com/tLDP/python-tldp
move generic function into BaseDoctype
This commit is contained in:
parent
3788c4d265
commit
80011bcf9d
|
@ -33,6 +33,13 @@ class BaseDoctype(object):
|
||||||
self.config = kwargs.get('config', None)
|
self.config = kwargs.get('config', None)
|
||||||
assert None not in (self.source, self.output, self.config)
|
assert None not in (self.source, self.output, self.config)
|
||||||
|
|
||||||
|
def build_precheck(self):
|
||||||
|
for tool, validator in self.required.items():
|
||||||
|
thing = getattr(self.config, tool, None)
|
||||||
|
assert thing is not None
|
||||||
|
assert validator(thing)
|
||||||
|
return True
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
# -- the output directory gets to prepare; must return True
|
# -- the output directory gets to prepare; must return True
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue