From 1475cf7890e5a04c7072ef6bd24dc06c13c576d5 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Tue, 23 Feb 2016 11:05:28 -0800 Subject: [PATCH] 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) --- tldp/doctypes/linuxdoc.py | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/tldp/doctypes/linuxdoc.py b/tldp/doctypes/linuxdoc.py index 8daf1a1..5883a0f 100644 --- a/tldp/doctypes/linuxdoc.py +++ b/tldp/doctypes/linuxdoc.py @@ -5,18 +5,19 @@ from __future__ import absolute_import, division, print_function import os -from ..utils import logger, which, execute -from .common import BaseDoctype, SignatureChecker +from tldp.utils import logger, which, execute +from tldp.utils import arg_isexecutable, isexecutable +from tldp.doctypes.common import BaseDoctype, SignatureChecker def config_fragment(p): - p.add_argument('--linuxdoc-sgml2html', type=str, + p.add_argument('--linuxdoc-sgml2html', type=arg_isexecutable, default=which('sgml2html'), help='full path to sgml2html [%(default)s]') - p.add_argument('--linuxdoc-html2text', type=str, + p.add_argument('--linuxdoc-html2text', type=arg_isexecutable, default=which('html2text'), help='full path to html2text [%(default)s]') - p.add_argument('--linuxdoc-htmldoc', type=str, + p.add_argument('--linuxdoc-htmldoc', type=arg_isexecutable, default=which('htmldoc'), help='full path to htmldoc [%(default)s]') @@ -25,16 +26,21 @@ class Linuxdoc(BaseDoctype, SignatureChecker): formatname = 'Linuxdoc' extensions = ['.sgml'] signatures = ['