]> git.lyx.org Git - lyx.git/commitdiff
Avoid code duplication.
authorEnrico Forestieri <forenr@lyx.org>
Mon, 29 Aug 2011 16:23:58 +0000 (16:23 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 29 Aug 2011 16:23:58 +0000 (16:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39561 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py

index 16c7e4c4cd1edc18beab1ba9000e9c6f68a9680a..382e1ca5c982f93bb9cd95f2970d6cdee0c52cc2 100644 (file)
@@ -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