From: Enrico Forestieri Date: Mon, 29 Aug 2011 16:23:58 +0000 (+0000) Subject: Avoid code duplication. X-Git-Tag: 2.1.0beta1~2765 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8e812f44af04dac05db0b45957c083ed6b682079;p=lyx.git Avoid code duplication. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39561 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/configure.py b/lib/configure.py index 16c7e4c4cd..382e1ca5c9 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -1111,23 +1111,14 @@ def checkLatexConfig(check_config, bool_docbook): cl.close() # # we have chklayouts.tex, then process it - cmd = LATEX + ' wrap_chkconfig.ltx' - if os.name == 'nt': - b = False - cmd = 'cmd /d /c ' + cmd - else: - b = True - pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \ - stdout=subprocess.PIPE, universal_newlines=True) - pipe.stdin.close() - while True: - line = pipe.stdout.readline() - if not line: - break; + ret = 1 + latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx') + for line in latex_out.splitlines(): if re.match('^\+', line): logger.info(line.strip()) - # if the command succeeds, None will be returned - ret = pipe.stdout.close() + # return None if the command succeeds + if line == "+Inspection done.": + ret = None # # currently, values in chhkconfig are only used to set # \font_encoding