]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
Add development manual.
[lyx.git] / lib / configure.py
index 58234c0d5a454443fe4b22481c4dec3205af0104..26af8e37c74c24799a9e11110a18e70a0eb81466 100644 (file)
@@ -56,9 +56,12 @@ def removeFiles(filenames):
             pass
 
 
-def cmdOutput(cmd):
+def cmdOutput(cmd, async = False):
     '''utility function: run a command and get its output as a string
         cmd: command to run
+        async: if False, return whole output as a string, otherwise
+               return the stdout handle from which the output can be
+               read (the caller is then responsible for closing it)
     '''
     if os.name == 'nt':
         b = False
@@ -68,6 +71,8 @@ def cmdOutput(cmd):
     pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
                             stdout=subprocess.PIPE, universal_newlines=True)
     pipe.stdin.close()
+    if async:
+        return pipe.stdout
     output = pipe.stdout.read()
     pipe.stdout.close()
     return output.strip()
@@ -563,6 +568,7 @@ def checkFormatEntries(dtl_tools):
         'pybliographic', 'bibdesk', 'gbib', 'kbib', \
         'kbibtex', 'sixpack', 'bibedit', 'tkbibtex' \
         'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
+        'jedit', 'TeXnicCenter', 'WinEdt', 'WinShell', 'PSPad', \
         'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
         rc_entry = [r'''\Format bibtex bib    "BibTeX"         "" ""   "%%"    ""      "text/x-bibtex"''' ])
     #
@@ -573,7 +579,7 @@ def checkFormatEntries(dtl_tools):
 \Format eps2       eps    "EPS (uncropped)"       "" "%%"      ""      "vector"        ""
 \Format ps         ps      Postscript             t  "%%"      ""      "document,vector,menu=export"   "application/postscript"'''])
     # for xdg-open issues look here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
-    checkViewer('a PDF previewer', ['kpdf', 'okular', 'evince', 'kghostview', 'xpdf', 'acrobat', 'acroread', \
+    checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'evince', 'kghostview', 'xpdf', 'acrobat', 'acroread', \
                    'gv', 'ghostview'],
         rc_entry = [r'''\Format pdf        pdf    "PDF (ps2pdf)"          P  "%%"      ""      "document,vector,menu=export"   "application/pdf"
 \Format pdf2       pdf    "PDF (pdflatex)"        F  "%%"      ""      "document,vector,menu=export"   ""
@@ -646,7 +652,7 @@ def checkConverterEntries():
 
     path, t2l = checkProg('a LaTeX/Noweb -> LyX converter', [in_place, 'tex2lyx' + version_suffix, 'tex2lyx'],
         rc_entry = [r'''\converter latex      lyx        "%% -f $$i $$o"       ""
-\converter literate   lyx        "%% -n -f $$i $$o"    ""'''], not_found = 'tex2lyx')
+\converter literate   lyx        "%% -n -m noweb -f $$i $$o"   ""'''], not_found = 'tex2lyx')
     if path == '':
         logger.warning("Failed to find tex2lyx on your system.")
 
@@ -1172,14 +1178,15 @@ def checkLatexConfig(check_config, bool_docbook):
     cl.close()
     #
     # we have chklayouts.tex, then process it
-    ret = 1
-    latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx')
-    for line in latex_out.splitlines():
+    latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx', True)
+    while True:
+        line = latex_out.readline()
+        if not line:
+            break;
         if re.match('^\+', line):
             logger.info(line.strip())
-            # return None if the command succeeds
-            if line == "+Inspection done.":
-                ret = None
+    # if the command succeeds, None will be returned
+    ret = latex_out.close()
     #
     # remove the copied file
     if rmcopy: