Commit Graph

73 Commits

Author SHA1 Message Date
Martin A. Brown 47b2930264 add --version handling logic in driver.py 2016-05-16 09:30:18 -07:00
Martin A. Brown 8a554a430d adding 2016 LDP copyright to each file 2016-04-29 11:02:02 -04:00
Martin A. Brown 53c476cebc pyflakes/pep8 adjustments 2016-04-28 12:12:41 -04:00
Martin A. Brown 3693264ca2 switch to using the doc.__name__, not doc.formatname 2016-04-20 22:38:45 -07:00
Martin A. Brown c947cfaf57 and remove the build directory, if empty 2016-04-18 12:25:20 -07:00
Martin A. Brown d4237eec58 report on failure/success count during the job
this allows somebody to kill the build in the middle, if there were any
failures
2016-04-02 10:54:35 -07:00
Martin A. Brown 9c3ed36bc2 fix publish function so it propagates return code 2016-03-27 02:26:42 -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 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 2c4f8407b5 convert explicitly to a list before return (Python3) 2016-03-14 21:41:46 -07:00
Martin A. Brown 6227e7d8da adjusting the reporting of discovered document counts 2016-03-14 10:34:44 -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 f7505627a5 pep8/pyflakes fixes 2016-03-10 11:17:09 -08:00
Martin A. Brown 7fbe4b80ec add width entry for doctype (output formatting) 2016-03-10 10:38:20 -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 29d5739d1e send runtime parameters to processors 2016-03-09 18:10:23 -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 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 b2e01eec73 removing useless vestiage 2016-03-07 22:12:59 -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 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 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 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 428e577c0d try not to go over 80 chars (attempt #3) 2016-03-04 21:44:50 -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 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 ee88d451a8 pyflakes/pep8 fixes 2016-03-01 22:53:07 -08:00
Martin A. Brown 6e11db3957 add a test case for when user specifies only stem as arg 2016-03-01 22:46:57 -08:00
Martin A. Brown 9cb92dce7c build() only returns 0 (success) for all builds
before, the build() function lacked the logic to retain, and return that there
was a failure during the building of one of the documents; it now returns
a 1, which is passed directly to sys.exit(), if any single build fails
2016-03-01 22:21:29 -08:00
Martin A. Brown dd6cda7726 improve diagnostic error messages a little bit 2016-03-01 14:32:14 -08:00
Martin A. Brown dfa729b9e5 restore driver.py to functionality
after refactoring into a bunch of separate functions, the tests finally pass
again
2016-03-01 14:10:51 -08:00
Martin A. Brown ae89d6814a inverted logic; caught in testing code 2016-03-01 13:36:09 -08:00
Martin A. Brown 2feb454c18 create more functions for the driver.py
Rearrange the logic for handling the various arguments so that it is
less obnoxious; breaking it into functions makes it easier to read (and test).
2016-03-01 13:21:26 -08:00
Martin A. Brown b54962900d allow case-insensitive matching for document types
The Python names for the document types are upper-cased and probably not
predictably named for the end user; allow a case-insensitive match when trying
to turn off building or listing for a particular document type.
2016-03-01 11:01:32 -08:00
Martin A. Brown aff926bb58 improve the handling of --skip 2016-03-01 10:30:18 -08:00
Martin A. Brown 6e2041692e skip orphaned documents passed into build() 2016-03-01 07:31:52 -08:00