In preparation for supporting a separate --builddir (allowing minimal
disruption of real output directory during rebuild) factor all output
directory handling logic into the main processor object (BaseDoctype).
Simplify the generate() method.
Centralize all pre-build logic in hook_build_prepare().
Remove all hook logic from the OutputDirectory.
in preparation for supporting a build-directory, moving the os.chdir() and the
copying of image files into tldp/doctypes/common.py and adding a few hooks in
the main logic for building
This patch prepares the way for simplifying the topological sort solution for
the classes which implement the document building logic. Formerly, each
doctype class had to import networx itself and the @depends decorator stuffed
the dependencies into a graph in the class variable.
Now, each method tracks its dependencies (same decorator trick), but the
topological sort is not computed until just before running the job. This is
more flexible, more obvious, simpler and features less code replication.
The next commit or two will convert the remaining doctype classes to use this
techinque.
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
it would be a problem if there's no self.required; don't protect against it
be clearer about which methods in which class are being called (debug)
do not fail with AssertionError if missing a tool, just skip to next doc
always call the processor AND output hook_build_{failure,success} methods
to allow individual subclasses of BaseDoctype to be able to implement as many
methods as they want to create document outputs, the BaseDoctype now
implements a graph of method dependencies. The sequence of tasks is
determined by applying the @depends decorator to the methods in the
heavy-lifting classes which actually implement the document procsesing.
For example, the Linuxdoc class will probably have about 6 or 7 methods to
generate the outputs, whereas, the more complex DocbookSGML class will have at
least two or three more to handle the build-time index-generation (if
necessary for the document).
rely directly on the logging module directly instead of through tldp.utils
add the BaseDoctype to all of the modules (even though not all are
implemented)