From 80011bcf9df49902f87a513215c2c61649d135cc Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Tue, 23 Feb 2016 12:18:17 -0800 Subject: [PATCH] move generic function into BaseDoctype --- tldp/doctypes/common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tldp/doctypes/common.py b/tldp/doctypes/common.py index 50f8509..307dbe3 100644 --- a/tldp/doctypes/common.py +++ b/tldp/doctypes/common.py @@ -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 #