remove the logic from the docbuild function which executes both the --script
generation and the --build generation as the core loop over the document set.
create ancillary functions to prepare the document set for --script mode or
--build mode
add functions to create and remove the build directories in --build mode
add a --publish cleanup function to leave our --builddir clean (unless there
was a failure)
created function removeOrphans() and removeUnknownDoctypes()
and the function runbuild() ugly name; which is called from all three of the
main work functions, build(), publish() and script()
abstract the error-handling away from the one-large run() function into each
of the functions (show_doctypes, show_statustypes, detail, summary, etc.)
add the function publish(), which will call build() and ensure success before
running any of the publishing
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.
the logic for making sure to chdir() into the build directory has been
sequestered into doctypes/common.py (and output.py); additionally, it is
smarter to put the resource copying logic, there, as well
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.