Commit Graph

130 Commits

Author SHA1 Message Date
Martin A. Brown 0ae4fd4806 flesh out support for DocBook 5.0
this is the main commit which provides support for generating documents from
sources written in DocBook 5.0.
2016-03-03 23:45:20 -08:00
Martin A. Brown 9a5bd5fd05 scripts look stupid without a final newline 2016-03-03 23:45:05 -08:00
Martin A. Brown 0ee742b64b add internal support for dumping shellscript
added support to the BaseDoctype class so that it can dump a script instead of
executing the script
2016-03-03 11:22:09 -08:00
Martin A. Brown 6ac2699fbf removing reference to unused variable buildorder 2016-03-02 23:52:29 -08:00
Martin A. Brown 369d53eb35 be louder about the signature finding (or not) 2016-03-02 23:51:27 -08:00
Martin A. Brown 17772e948c call xmllint before doing any other work
important to validate the document before processing it;
Note!  Adding this feature flushed out a number of sketchy corners of a few of
our documents, but almost everything validated already.
2016-03-02 23:50:19 -08:00
Martin A. Brown 2094199462 pyflakes/pep8 fixes 2016-03-01 22:58:37 -08:00
Martin A. Brown 97181b167a temporarily forgetting about other doctypes 2016-03-01 21:50:58 -08:00
Martin A. Brown d28460aaff bump up verbosity of failed excute() to logger.info 2016-03-01 21:38:16 -08:00
Martin A. Brown 17ffc0434f make the sought text more obvious in logging output 2016-03-01 19:51:19 -08:00
Martin A. Brown 8792b4c83a make individual assertions 2016-03-01 08:20:57 -08:00
Martin A. Brown 36e92b83d9 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
2016-02-27 11:13:58 -08:00
Martin A. Brown 5f11427f38 remove pipe from script 2016-02-27 10:46:18 -08:00
Martin A. Brown 55cc7d5775 improve visual grouping of --help output
use argparse's ArgumentGroups to separate the argparse options for each of the
processors
2016-02-27 09:45:32 -08:00
Martin A. Brown eac92b5354 add the document stem to the __repr__ 2016-02-26 23:18:50 -08:00
Martin A. Brown 9137946a05 adding timing to a few methods 2016-02-26 23:02:00 -08:00
Martin A. Brown 1c4f283482 handle the images and resources during publication 2016-02-26 22:18:02 -08:00
Martin A. Brown 39c4a13d88 repair logic for when there is no index.sgml 2016-02-26 19:04:51 -08:00
Martin A. Brown f739e365c0 do not bother generating index.sgml unless desirable/necessary 2016-02-26 18:15:27 -08:00
Martin A. Brown f1bc2121a6 moving hook_build_{success,failure} to BaseDoctype 2016-02-26 12:08:05 -08:00
Martin A. Brown 80d692efba massive simplification of generate() method
move hook_build_success() and hook_build_failure() into BaseDoctype;
subclasses can always override, if need be
2016-02-26 12:06:34 -08:00
Martin A. Brown 89d8f14231 pyflakes fix 2016-02-26 12:06:27 -08:00
Martin A. Brown 3a0bb65961 switch to the DAG model 2016-02-26 12:06:17 -08:00
Martin A. Brown 84477c0f45 move cleanup() method to BaseDoctype 2016-02-26 11:58:56 -08:00
Martin A. Brown 66f11e5f3b move cleanup() method to BaseDoctype 2016-02-26 11:58:43 -08:00
Martin A. Brown 5602ab68dd pep8 fixes 2016-02-26 11:56:28 -08:00
Martin A. Brown 9d1f066085 better PDF generation logic; add cleanup()
try to make the PDF first with jw, but don't quit if that fails
fall back to PDF generation with dblatex and tell the user
cleanup any generated index.sgml (if we made it)
2016-02-26 11:22:00 -08:00
Martin A. Brown 06194feba8 build sequence resilience/terseness) improvements
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
2016-02-26 11:19:30 -08:00
Martin A. Brown 62f96f3bcb add a postamble, too (extra newlines, only) 2016-02-26 10:10:45 -08:00
Martin A. Brown f112fc98d1 switch to the DAG model 2016-02-26 10:10:29 -08:00
Martin A. Brown 2b65730f25 adjusting logging verbosity 2016-02-26 01:07:09 -08:00
Martin A. Brown 4e76494cce rework the build sequence
adapt all of the methods to the new topological-sort driven technique
2016-02-26 01:02:16 -08:00
Martin A. Brown 74bdfcd44f improve logging a little bit 2016-02-26 01:00:43 -08:00
Martin A. Brown 85b2b15c3b build a graph of method dependencies
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).
2016-02-26 00:30:37 -08:00
Martin A. Brown 65a80f1339 add __name__ to getLogger() calls 2016-02-25 12:29:55 -08:00
Martin A. Brown e74197eb01 pull logger straight from logging; add BaseDoctype
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)
2016-02-25 11:37:14 -08:00
Martin A. Brown 7903d5f497 config_fragment becomes staticmethod in class
the config_fragment function becomes a part of each doctype class, allowing
better encapsulation of most/all document type handling logic
the config_fragment function becomes a staticmethod called argparse
2016-02-25 10:35:46 -08:00
Martin A. Brown 89cb766ad7 clean up the stray index.sgml left hanging around 2016-02-23 23:30:07 -08:00
Martin A. Brown fc2cdf975d switch all processors to generated shell scripts 2016-02-23 22:44:17 -08:00
Martin A. Brown ce359dfa32 generic method shellscript() cannot test if job is done 2016-02-23 22:37:59 -08:00
Martin A. Brown 8630157046 adapt to generated shellscript model 2016-02-23 21:59:47 -08:00
Martin A. Brown ad2a1763ec move method shellscript into BaseDoctype
and fix a few errors in the generated DocBook XML 4.x script
2016-02-23 21:58:03 -08:00
Martin A. Brown f1343deb00 try out a shellscript writing technique instead 2016-02-23 21:17:30 -08:00
Martin A. Brown 7da0670d23 add just a bit more warning bells 2016-02-23 21:17:01 -08:00
Martin A. Brown 83b998cb51 trying to write and execute a shell script 2016-02-23 21:16:44 -08:00
Martin A. Brown d5524f09ee move generic function into BaseDoctype 2016-02-23 12:18:33 -08:00
Martin A. Brown 80011bcf9d move generic function into BaseDoctype 2016-02-23 12:18:17 -08:00
Martin A. Brown 3788c4d265 get rid of the paths in mabrown home dir 2016-02-23 12:16:17 -08:00
Martin A. Brown a415484b5a separate operations by method and dependencies
use the generalized build sequence running supported by doctypes/common.py
2016-02-23 11:57:37 -08:00
Martin A. Brown df75f051db generalizing build sequence logic
ready for use in first doctype (linuxdoc)
2016-02-23 11:56:58 -08:00
Martin A. Brown 08df7acbe2 rework tracking of success vector 2016-02-23 11:08:04 -08:00
Martin A. Brown 1475cf7890 use arg_ checking functions; add build_precheck
rename platform_check to build_precheck
refer to arg_ checking functions from utils
ensure that just before each build we validate executables
avoid FD leakage by using with ... context for outf (stdout)
2016-02-23 11:05:28 -08:00
Martin A. Brown 51fabb65d7 change platform to config 2016-02-23 09:43:27 -08:00
Martin A. Brown 3a0ee539fa adding [%(default)s] to each argparse entry 2016-02-23 09:08:08 -08:00
Martin A. Brown 3f37d09fe9 add configurables and discovery of files
add argparse-style support to each doctype module, for path-configurables
also add the runtime discovery of files needed for document handling (e.g. XSL
and DSSSL files)
2016-02-22 12:32:35 -08:00
Martin A. Brown a959db5485 initial configuration snippets 2016-02-21 17:49:14 -08:00
Martin A. Brown 809ddc545b adding # -*- coding: utf8 -*- 2016-02-18 13:25:02 -08:00
Martin A. Brown a34738301f removing extraneous logging entry 2016-02-18 09:16:37 -08:00
Martin A. Brown ffc0ad6547 improve readability, parallelism of methods by inverting logic 2016-02-17 19:05:23 -08:00
Martin A. Brown 1039dea0e6 let the prebuild_hook call clean 2016-02-17 19:04:51 -08:00
Martin A. Brown fd3b931423 include hooks for prebuild and postbuild states 2016-02-17 18:31:51 -08:00
Martin A. Brown a0de081099 minor logging tweaking 2016-02-17 17:56:42 -08:00
Martin A. Brown 2b0b241019 adjusting format names 2016-02-17 13:49:33 -08:00
Martin A. Brown f39237d307 removing commented block that lives in superclass, BaseDoctype 2016-02-16 23:39:56 -08:00
Martin A. Brown 547cb303f6 pep8 and pyflakes fixes (and variable renaming) 2016-02-16 00:03:58 -08:00
Martin A. Brown 5e05b0f30d starting to wear the belt and suspenders 2016-02-15 23:58:50 -08:00
Martin A. Brown cc6caec3a4 improving readability and simplicity 2016-02-15 20:59:49 -08:00
Martin A. Brown f9aa61fa32 revise BaseDoctype to add generic generation method 2016-02-15 20:59:25 -08:00
Martin A. Brown 61f2538927 first working example of Linuxdoc processor 2016-02-15 14:04:09 -08:00
Martin A. Brown f1c40c1e8c create BaseDoctype with features needed by all
each document processor will need to know about its
sources, outputs and the platform details
the generate() method is a temporary model for operation
2016-02-15 13:58:32 -08:00
Martin A. Brown a7a0fe38b3 adding two unused doctypes 2016-02-12 13:25:19 -08:00
Martin A. Brown 85b8df5e86 method .index removed from Python3 string module; not needed anyway 2016-02-12 13:24:55 -08:00
Martin A. Brown 7c70a7c4b8 formatname must be a string 2016-02-12 13:00:11 -08:00
Martin A. Brown 5263a3a219 fleshing out the linuxdoc processing commands 2016-02-12 12:49:50 -08:00
Martin A. Brown 4652345b7a adding basic required methods 2016-02-12 12:43:45 -08:00
Martin A. Brown 7b97f221bf f argument is file object; also renaming fin to f
fin was the argument and was a filelike object, but
it was pointless, now it is just a file object and called f;
also shrinking the length of two logging lines
2016-02-12 12:25:34 -08:00
Martin A. Brown ce72500bbd fleshing out commands and support for linuxdoc 2016-02-11 11:29:23 -08:00
Martin A. Brown 627e2ff636 changing to __future__ (consistency across project) 2016-02-11 11:28:38 -08:00
Martin A. Brown 8670927ac6 adding commands for Linuxdoc format 2016-02-11 09:15:50 -08:00
Martin A. Brown 701657e54b initial commit 2016-02-10 19:22:23 -08:00