move generic function into BaseDoctype

This commit is contained in:
Martin A. Brown 2016-02-23 12:18:17 -08:00
parent 3788c4d265
commit 80011bcf9d
1 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,13 @@ class BaseDoctype(object):
self.config = kwargs.get('config', None)
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):
# -- the output directory gets to prepare; must return True
#