Martin A. Brown
deaee034fc
make an end run around the XSL/fop problem
...
teach the DocBook4 XML utility itself to set fop.extensions = 0 and
fop1.extensions = 1 until such time as the upstream ldp-docbook-xsl packages
can be repaired and/or adjusted
2016-03-27 00:44:00 -07:00
Martin A. Brown
f2ef7d2184
support --script mode anywhere and don't chdir()
2016-03-24 09:00:20 -07:00
Martin A. Brown
746197d954
match up the detail method on the OutputDirectory with the SourceDocument
2016-03-18 20:06:52 -07:00
Martin A. Brown
d094e9365a
specify the footer to use
2016-03-16 16:12:25 -07:00
Martin A. Brown
e4b5c5d8bb
need to fall back to iso-8859-1 for SGML docs
2016-03-15 13:26:03 -07:00
Martin A. Brown
dfd65b43f3
use an empty (unicode_literal) string to trick future print() [function] to producing unicode strings rather than Py2 byte strings
2016-03-14 22:27:15 -07:00
Martin A. Brown
3f92a7a95c
everybody gets unicode_literals
2016-03-14 22:18:09 -07:00
Martin A. Brown
dcb8b3a217
switch to codecs.open and expect UTF-8 data
2016-03-14 21:42:31 -07:00
Martin A. Brown
2afbc7a147
switch to codecs.open and expect UTF-8 data
2016-03-14 21:42:21 -07:00
Martin A. Brown
bb7fbccc6b
switch to codecs.open and expect UTF-8 data
2016-03-14 21:42:07 -07:00
Martin A. Brown
2c4f8407b5
convert explicitly to a list before return (Python3)
2016-03-14 21:41:46 -07:00
Martin A. Brown
f20fb1c481
no point in using makefh() now; remove
2016-03-14 20:51:55 -07:00
Martin A. Brown
26de64a2bb
stop leaking FDs when guessing doctypes
2016-03-14 20:32:42 -07:00
Martin A. Brown
a2daee9425
use absolute_import here, too (Python 3)
2016-03-14 20:32:09 -07:00
Martin A. Brown
5af0c2a955
use the proper Python 3.x name for [Safe]ConfigParser
2016-03-14 20:11:04 -07:00
Martin A. Brown
6227e7d8da
adjusting the reporting of discovered document counts
2016-03-14 10:34:44 -07:00
Martin A. Brown
01756a16ec
add support for sgmlcheck (linuxdoc)
2016-03-13 09:41:55 -07:00
Martin A. Brown
61d55a9f69
CLI-tool friendly handling of EPIPE and INT
...
And, correcting from the name of the Python class to the format name processed
by the Python class (class.__name__ vs. class.formatname).
2016-03-11 14:21:56 -08:00
Martin A. Brown
5f6ff9ca3d
report the output directory first
2016-03-10 11:55:55 -08:00
Martin A. Brown
d59850d433
skip adding to removals if in --script mode
2016-03-10 11:42:59 -08:00
Martin A. Brown
f7505627a5
pep8/pyflakes fixes
2016-03-10 11:17:09 -08:00
Martin A. Brown
90f8d6e690
add format name to --list output (for sources)
2016-03-10 10:38:40 -08:00
Martin A. Brown
7fbe4b80ec
add width entry for doctype (output formatting)
2016-03-10 10:38:20 -08:00
Martin A. Brown
c214724fcb
group methods a bit more by their similarity
...
and change naming slightly so log lines at loglevel INFO align
2016-03-10 10:25:39 -08:00
Martin A. Brown
7bd32896eb
create variable DEFAULT_CONFIGFILE
...
so that at runtime (during testing), it can be overridden
2016-03-10 08:50:31 -08:00
Martin A. Brown
8a99c39d93
switched to set(), use .add() instead of .append()
2016-03-10 08:49:37 -08:00
Martin A. Brown
f0cb2c3dfe
only try to remove files once
2016-03-10 08:49:03 -08:00
Martin A. Brown
c978cf5dff
report on documents by document format, too
2016-03-09 23:41:50 -08:00
Martin A. Brown
e2532d4ffb
use the already written darned function
2016-03-09 20:53:21 -08:00
Martin A. Brown
46d16f4ccb
complete the propagation of **kwargs
2016-03-09 20:41:18 -08:00
Martin A. Brown
29d5739d1e
send runtime parameters to processors
2016-03-09 18:10:23 -08:00
Martin A. Brown
94ab1ac5d2
pass **kwargs through all processor tools
...
adjust all processor tools so they take runtime parameters through **kwargs
2016-03-09 18:08:56 -08:00
Martin A. Brown
2d75d3c4de
remove old boilerplate from markdown and rst stock code
2016-03-09 18:08:18 -08:00
Martin A. Brown
c581980aaf
remove old boilerplate from markdown and rst stock code
2016-03-09 18:07:52 -08:00
Martin A. Brown
a06e1955b7
tweak logging outputs, lower some to debug()
2016-03-09 10:06:59 -08:00
Martin A. Brown
68b16b42d8
simplify function docbuild: logging by caller
...
make the core docbuild function even simpler; have it determine the result
and return it, as well as the individual build success/failure vector
move all logging logic into the caller function, so that script(), publish()
and build() can log whatever they like
2016-03-09 10:00:25 -08:00
Martin A. Brown
f4367e943f
improve testing coverage of driver.py
...
adjust calling pattern for prepare_{script,build}_mode so that they are easier
to test
embed the creation of build directories into the prepare_build_mode
2016-03-09 09:33:04 -08:00
Martin A. Brown
a488ae53de
add testing support for new format Asciidoc
2016-03-09 08:09:52 -08:00
Martin A. Brown
0c433d7306
removing text (will be supported by asciidoc)
2016-03-09 07:54:55 -08:00
Martin A. Brown
885d6a12f3
adding support for format asciidoc
...
simply using DocBook4XML to provide most of the effort
2016-03-09 07:39:14 -08:00
Martin A. Brown
7aa99ec502
moving sameFilesystem to utils.py
2016-03-08 09:45:54 -08:00
Martin A. Brown
ea2139373c
simplify docbuild function; factor out logic
...
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)
2016-03-08 09:16:46 -08:00
Martin A. Brown
ffe327ced0
removing boilerplate; go from asciidoc to docbook45
2016-03-08 09:16:33 -08:00
Martin A. Brown
62c9cef32f
docbooksgml needs to know about --script mode
2016-03-08 09:16:12 -08:00
Martin A. Brown
ca8b8e211f
minor cosmetic improvements to generated shell file
2016-03-08 09:11:09 -08:00
Martin A. Brown
e7794eea20
relocating function
2016-03-07 22:13:23 -08:00
Martin A. Brown
b2e01eec73
removing useless vestiage
2016-03-07 22:12:59 -08:00
Martin A. Brown
be78491fd6
do not allow None as the b argument (crazy)
2016-03-07 19:57:17 -08:00
Martin A. Brown
99d93fb4ce
allow None as the b argument
2016-03-07 19:56:27 -08:00
Martin A. Brown
9dd87b4d7a
add an empty entry for "working" attribute
2016-03-07 18:54:32 -08:00
Martin A. Brown
bd7b08ce23
OK, so a can be anything, not just a directory
2016-03-07 18:54:08 -08:00
Martin A. Brown
87e1161212
add support to driver for --builddir logic
...
create the --builddir before building
if --publish, swap the built directory with the output directory
then --remove the old content
2016-03-07 18:52:13 -08:00
Martin A. Brown
b2a8ac28d2
adding an empty attribute called "build"
2016-03-07 15:04:54 -08:00
Martin A. Brown
8c6ceba912
adding a function to swap directories
2016-03-07 15:04:16 -08:00
Martin A. Brown
015b3459f4
more refactoring, heading toward --publish
...
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()
2016-03-07 13:50:15 -08:00
Martin A. Brown
dab1fc6bbc
abstract error-handling; prepare for --publish
...
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
2016-03-07 13:21:38 -08:00
Martin A. Brown
30d44a75f8
better refactoring of the large "run" method
2016-03-07 12:39:22 -08:00
Martin A. Brown
814dfec181
pep8/pyflakes fixes
2016-03-07 12:12:34 -08:00
Martin A. Brown
76fd27d1fa
pep8/pyflakes fixes
2016-03-07 12:10:49 -08:00
Martin A. Brown
517a29b4a8
switch to using os.EX_OK for sys.exit()
...
also more preparation for switching to use --builddir
2016-03-07 12:02:25 -08:00
Martin A. Brown
dfc20c5617
move directory-handling logic to the processor
...
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.
2016-03-07 11:34:09 -08:00
Martin A. Brown
c390e71b4a
removing all chdir() and resource copying logic
...
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
2016-03-07 10:20:55 -08:00
Martin A. Brown
98b19ac5ce
do not mkdir() if we are in --script mode
2016-03-07 10:01:42 -08:00
Martin A. Brown
fc4c83307f
do not mkdir() if we are in --script mode
2016-03-07 10:01:26 -08:00
Martin A. Brown
99d6232259
simplify text in commented lines
2016-03-07 10:00:51 -08:00
Martin A. Brown
f87458c461
rearranging and renaming build setup methods
...
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
2016-03-07 09:50:22 -08:00
Martin A. Brown
7308f331ff
parameterize the --resources to copy at build time
2016-03-07 09:39:34 -08:00
Martin A. Brown
9c8746e486
and report on the output directory, if present
2016-03-07 09:15:17 -08:00
Martin A. Brown
b30e2af282
require exact signature match; stop with .lower()
...
was comparing for case insensitive matches when locating signatures; probably
a bad idea; better to simply require an exact match
2016-03-07 09:11:35 -08:00
Martin A. Brown
853aec028b
a bit more info, when --verbose
2016-03-07 09:04:25 -08:00
Martin A. Brown
59bcafb874
add --publish option
...
in preparation for separating --publish and --build, add the option
2016-03-07 09:03:57 -08:00
Martin A. Brown
a002fd926d
add --publish option
...
in preparation for separating --publish and --build, add the option
2016-03-07 09:00:15 -08:00
Martin A. Brown
0e955fce06
check --builddir/--pubdir on same filesystem
...
ensure that both the --builddir and the --pubdir are on the same filesystem
so that we can (reasonably) safely os.rename() after the build is done
2016-03-07 08:39:34 -08:00
Martin A. Brown
bfc8328181
be just a touch more informative about what went wrong
2016-03-07 08:13:50 -08:00
Martin A. Brown
88ee1bf5fa
support new option --builddir
2016-03-07 08:06:17 -08:00
Martin A. Brown
e6b6ea7b40
add support for --doctypes and --statustypes
...
provide CLI-discoverable listing of supported source document types and status
types
2016-03-06 11:29:13 -08:00
Martin A. Brown
bfd6c1a0a1
tldp/doctypes/docbook4xml.py
...
correct dependency listings for validated source removal
2016-03-05 19:24:05 -08:00
Martin A. Brown
760cd392f4
use newer, simpler topo-sort for dependency tracking
2016-03-05 17:08:33 -08:00
Martin A. Brown
4c01ae4af7
simplify topological dependency solution
...
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.
2016-03-05 17:04:45 -08:00
Martin A. Brown
7d287b44e5
the required items should say asciidoc_
2016-03-05 15:58:26 -08:00
Martin A. Brown
428e577c0d
try not to go over 80 chars (attempt #3 )
2016-03-04 21:44:50 -08:00
Martin A. Brown
93fb5b3356
quote that argument
2016-03-04 21:34:44 -08:00
Martin A. Brown
d8f14c9e55
initial support for asciidoc format
2016-03-04 17:10:30 -08:00
Martin A. Brown
f617cca3d3
add support for Asciidoc detection
2016-03-04 17:10:21 -08:00
Martin A. Brown
50af88ebde
switch to os.path.exists(), prep for chunked is own subdir
2016-03-04 17:07:36 -08:00
Martin A. Brown
1dbc0e5f8b
always log the contents of the tldp-build-* files in --debug mode
2016-03-04 17:06:55 -08:00
Martin A. Brown
5f9533045c
shrink the total window width (want to fit in 80 cols)
2016-03-04 12:43:28 -08:00
Martin A. Brown
2a0e383c26
run the xinclude first, then validate document
2016-03-04 11:46:17 -08:00
Martin A. Brown
3e1b732b32
correct the help string for docbook.rng
2016-03-04 08:53:53 -08:00
Martin A. Brown
92e7c8bc89
lowering verbosity on reporting tool/data detection
2016-03-04 07:58:03 -08:00
Martin A. Brown
bba998b7b9
adding NS XSL fs locations for Debian
2016-03-04 07:53:29 -08:00
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
c8f489ef5d
reset logging level after parsing all configs
2016-03-03 14:03:38 -08:00
Martin A. Brown
7359af070d
adjust and reorganize imports
2016-03-03 11:27:19 -08:00
Martin A. Brown
b092e09516
add support for --script; shorten names
...
adding support for the --script option
shortening the names in the script since it was getting fairly redundant to
keep typing tldp.outputs.Output*, tldp.inventory.Inventory and
tldp.sources.Source*
2016-03-03 11:23:54 -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
e2aff4f388
add alternate constructor
2016-03-03 11:21:54 -08:00
Martin A. Brown
83e1c7a57b
needed output.validsource for DocBook XML xmllint validation
2016-03-02 23:52:50 -08:00
Martin A. Brown
6ac2699fbf
removing reference to unused variable buildorder
2016-03-02 23:52:29 -08:00