From 36e92b83d9adbc0051995268b7427871848653e0 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Sat, 27 Feb 2016 11:13:58 -0800 Subject: [PATCH] perform the processor prebuild check first it is smarter to perform the non-destructive check first, rather than blowing away the output directory and then reporting that it is impossible to rebuild the document output tree --- tldp/doctypes/common.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tldp/doctypes/common.py b/tldp/doctypes/common.py index 8e2f300..5ee4754 100644 --- a/tldp/doctypes/common.py +++ b/tldp/doctypes/common.py @@ -154,19 +154,21 @@ class BaseDoctype(object): # -- the output directory gets to prepare; must return True # - if not self.output.hook_prebuild(): - return False - - opwd = os.getcwd() - os.chdir(self.output.dirname) - # -- the processor gets to prepare; must return True # if not self.build_precheck(): logger.warning("%s %s failed (%s), skipping to next build", - 'build_precheck', stem, classname) + stem, 'build_precheck', classname) return False + if not self.output.hook_prebuild(): + logger.warning("%s %s failed (%s), skipping to next build", + stem, 'hook_prebuild', classname) + return False + + opwd = os.getcwd() + os.chdir(self.output.dirname) + # -- now, we can try to build everything; this is the BIG WORK! # result = self.buildall()