]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
Whitespace
[lyx.git] / lib / configure.py
index ae987ef63f108be3b5cb66543f104acfa90e712d..2379b35ef4bb0e22ccfad13224490eea2717c8e2 100644 (file)
@@ -62,7 +62,7 @@ def cmdOutput(cmd):
     '''
     if os.name == 'nt':
         b = False
-        cmd = 'cmd /d /c ' + cmd
+        cmd = 'cmd /d /c pushd ' + os.getcwd() + '&' + cmd
     else:
         b = True
     pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
@@ -109,9 +109,13 @@ def checkTeXPaths():
         from tempfile import mkstemp
         fd, tmpfname = mkstemp(suffix='.ltx')
         if os.name == 'nt':
+            from locale import getdefaultlocale
             from ctypes import windll, create_unicode_buffer
             GetShortPathName = windll.kernel32.GetShortPathNameW
-            longname = unicode(tmpfname)
+            language, encoding = getdefaultlocale()
+            if encoding == None:
+                encoding = 'latin1'
+            longname = unicode(tmpfname, encoding)
             shortlen = GetShortPathName(longname, 0, 0)
             shortname = create_unicode_buffer(shortlen)
             if GetShortPathName(longname, shortname, shortlen):
@@ -120,7 +124,7 @@ def checkTeXPaths():
                 inpname = tmpfname.replace('\\', '/')
         else:
             inpname = cmdOutput('cygpath -m ' + tmpfname)
-        logname = os.path.basename(inpname.replace('.ltx', '.log'))
+        logname = os.path.basename(re.sub("(?i).ltx", ".log", inpname))
         inpname = inpname.replace('~', '\\string~')
         os.write(fd, r'\relax')
         os.close(fd)
@@ -516,7 +520,7 @@ def checkFormatEntries(dtl_tools):
         (iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie) )
     #
     checkViewerEditor('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
-        'nedit', 'gedit', 'notepad'],
+        'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
         rc_entry = [r'''\Format asciichess asc    "Plain text (chess output)"  "" ""   "%%"    ""      ""
 \Format asciiimage asc    "Plain text (image)"         "" ""   "%%"    ""      ""
 \Format asciixfig  asc    "Plain text (Xfig output)"   "" ""   "%%"    ""      ""
@@ -540,7 +544,8 @@ def checkFormatEntries(dtl_tools):
 \Format text2      txt    "Plain text (pstotext)" "" ""        "%%"    "document"      ""
 \Format text3      txt    "Plain text (ps2ascii)" "" ""        "%%"    "document"      ""
 \Format text4      txt    "Plain text (catdvi)"   "" ""        "%%"    "document"      ""
-\Format textparagraph txt "Plain Text, Join Lines" "" ""       "%%"    "document"      ""''' ])
+\Format textparagraph txt "Plain Text, Join Lines" "" ""       "%%"    "document"      ""
+\Format beamer.info pdf.info   "Info (Beamer)"         "" ""   "%%"    "document,menu=export"  ""''' ])
    #Spreadsheets using ssconvert from gnumeric
     checkViewer('gnumeric spreadsheet software', ['gnumeric'],
       rc_entry = [r'''\Format gnumeric gnumeric "Gnumeric spreadsheet" "" ""    "%%"   "document"      "application/x-gnumeric"
@@ -554,7 +559,7 @@ def checkFormatEntries(dtl_tools):
         'pybliographic', 'bibdesk', 'gbib', 'kbib', \
         'kbibtex', 'sixpack', 'bibedit', 'tkbibtex' \
         'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
-        'nedit', 'gedit', 'notepad'],
+        'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
         rc_entry = [r'''\Format bibtex bib    "BibTeX"         "" ""   "%%"    ""      "text/x-bibtex"''' ])
     #
     #checkProg('a Postscript interpreter', ['gs'],
@@ -585,11 +590,11 @@ def checkFormatEntries(dtl_tools):
     checkViewerEditor('Noteedit', ['noteedit'],
         rc_entry = [r'\Format noteedit   not     Noteedit               "" "%%"        "%%"    "vector"        ""'])
     #
-    checkViewerEditor('an OpenDocument/OpenOffice viewer', ['libreoffice', 'lwriter', 'swriter', 'oowriter', 'abiword'],
+    checkViewerEditor('an OpenDocument/OpenOffice viewer', ['libreoffice', 'lwriter', 'lowriter', 'oowriter', 'swriter', 'abiword'],
         rc_entry = [r'''\Format odt        odt     OpenDocument           "" "%%"      "%%"    "document,vector,menu=export"   "application/vnd.oasis.opendocument.text"
 \Format sxw        sxw    "OpenOffice.Org (sxw)"  "" ""        ""      "document,vector"       "application/vnd.sun.xml.writer"'''])
     #
-    checkViewerEditor('a Rich Text and Word viewer', ['libreoffice', 'lwriter', 'swriter', 'oowriter', 'abiword'],
+    checkViewerEditor('a Rich Text and Word viewer', ['libreoffice', 'lwriter', 'lowriter', 'oowriter', 'swriter', 'abiword'],
         rc_entry = [r'''\Format rtf        rtf    "Rich Text Format"      "" "%%"      "%%"    "document,vector,menu=export"   "application/rtf"
 \Format word       doc    "MS Word"               W  "%%"      "%%"    "document,vector,menu=export"   "application/msword"'''])
     #
@@ -758,6 +763,9 @@ def checkConverterEntries():
     checkProg('a PDF to EPS converter', ['pdftops -eps -f 1 -l 1 $$i $$o'],
         rc_entry = [ r'\converter pdf         eps        "%%"  ""' ])
     #
+    checkProg('a Beamer info extractor', ['makebeamerinfo -p $$i'],
+        rc_entry = [ r'\converter pdf2         beamer.info        "%%" ""' ])
+    #
     checkProg('a DVI to TXT converter', ['catdvi $$i > $$o'],
         rc_entry = [ r'\converter dvi        text4      "%%"   ""' ])
     #
@@ -1079,6 +1087,12 @@ def checkLatexConfig(check_config, bool_docbook):
                     tx.write(retval)
         tx.close()
         logger.info('\tdone')
+    if not os.path.isfile('packages.lst') or not check_config:
+        logger.info('+generating default list of packages... ')
+        removeFiles(['packages.lst'])
+        tx = open('packages.lst', 'w')
+        tx.close()
+        logger.info('\tdone')
     if not check_config:
         return None
     # the following will generate textclass.lst.tmp, and packages.lst.tmp