]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
Fix for bug 3321. Changed error message.
[lyx.git] / lib / configure.py
index b8629cf0344f6a846ab0544a76463cb50ab51e52..3c29dc2271fead1b8dc267fdac89514439f50894 100644 (file)
@@ -8,7 +8,7 @@
 # \author Bo Peng
 # Full author contact details are available in file CREDITS.
 
-import sys, os, re, shutil, glob, commands
+import sys, os, re, shutil, glob
 
 
 class Tee:
@@ -238,8 +238,8 @@ def checkFormatEntries(dtl_tools):
     checkViewer('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'],
         rc_entry = [r'\Format fen        fen     FEN                    "" "%%"        "%%"    ""'])
     #
-    path, iv = checkViewer('a raster image viewer', ['xv', 'kview', 'gimp'])
-    path, ie = checkViewer('a raster image editor', ['gimp'])
+    path, iv = checkViewer('a raster image viewer', ['xv', 'kview', 'gimp-remote', 'gimp'])
+    path, ie = checkViewer('a raster image editor', ['gimp-remote', 'gimp'])
     addToRC(r'''\Format bmp        bmp     BMP                    "" "%s"      "%s"    ""
 \Format gif        gif     GIF                    "" "%s"      "%s"    ""
 \Format jpg        jpg     JPEG                   "" "%s"      "%s"    ""
@@ -289,7 +289,7 @@ def checkFormatEntries(dtl_tools):
         # Windows only: DraftDVI
         addToRC(r'\Format dvi2       dvi     DraftDVI               "" ""      "document,vector"')
     #
-    checkViewer('an HTML previewer', ['mozilla file://$$p$$i', 'netscape'],
+    checkViewer('an HTML previewer', ['firefox', 'mozilla file://$$p$$i', 'netscape'],
         rc_entry = [r'\Format html       html    HTML                   H  "%%"        ""      "document"'])
     #
     checkViewer('Noteedit', ['noteedit'],
@@ -301,6 +301,9 @@ def checkFormatEntries(dtl_tools):
 \Format lyx        lyx     LyX                    "" ""        ""      ""
 \Format lyx13x     lyx13  "LyX 1.3.x"             "" ""        ""      "document"
 \Format lyx14x     lyx14  "LyX 1.4.x"             "" ""        ""      "document"
+\Format clyx       cjklyx "CJK LyX 1.4.x (big5)"  "" ""        ""      "document"
+\Format jlyx       cjklyx "CJK LyX 1.4.x (euc-jp)" "" ""       ""      "document"
+\Format klyx       cjklyx "CJK LyX 1.4.x (euc-kr)" "" ""       ""      "document"
 \Format lyxpreview lyxpreview "LyX Preview"       "" ""        ""      ""
 \Format pdftex     pdftex_t PDFTEX                "" ""        ""      ""
 \Format program    ""      Program                "" ""        ""      ""
@@ -406,13 +409,10 @@ def checkConverterEntries():
     checkProg('an EPS -> PDF converter', ['epstopdf'],
         rc_entry = [ r'\converter eps        pdf        "epstopdf --outfile=$$o $$i"   ""', ''])
     #
-    path, convert = checkProg('a PDF -> PNG converter', ['convert'])
-    if convert != '':
-        # check whether convert supports the -define option
-        conv_opts = "-define pdf:use-cropbox=true -depth 8"
-        if not 'Unrecognized' in commands.getoutput('convert ' + conv_opts):
-            addToRC(r'\converter pdf        png        "convert %s pdf:$$i png:$$o"    ""' % conv_opts)
-    #
+    # no agr -> pdf converter, since the pdf library used by gracebat is not
+    # free software and therefore not compiled in in many installations.
+    # Fortunately, this is not a big problem, because we will use epstopdf to
+    # convert from agr to pdf via eps without loss of quality.
     checkProg('a Grace -> Image converter', ['gracebat'],
         rc_entry = [
             r'''\converter agr        eps        "gracebat -hardcopy -printfile $$o -hdevice EPS $$i 2>/dev/null"      ""
@@ -449,15 +449,21 @@ def checkConverterEntries():
     # FIXME: no rc_entry? comment it out
     # checkProg('Image converter', ['convert $$i $$o'])
     #
-    # Entried that do not need checkProg
+    # Entries that do not need checkProg
     addToRC(r'''\converter lyxpreview ppm        "python -tt $$s/scripts/lyxpreview2bitmap.py" ""
-\converter date       dateout    "date +%d-%m-%Y > $$o"        ""
+\converter date       dateout    "python -tt $$s/scripts/date.py %d-%m-%Y > $$o"       ""
 \converter docbook    docbook-xml "cp $$i $$o" "xml"
 \converter fen        asciichess "python -tt $$s/scripts/fen2ascii.py $$i $$o" ""
 \converter fig        pdftex     "python -tt $$s/scripts/fig2pdftex.py $$i $$o"        ""
 \converter fig        pstex      "python -tt $$s/scripts/fig2pstex.py $$i $$o" ""
 \converter lyx        lyx13x     "python -tt $$s/lyx2lyx/lyx2lyx -t 221 $$i > $$o"     ""
 \converter lyx        lyx14x     "python -tt $$s/lyx2lyx/lyx2lyx -t 245 $$i > $$o"     ""
+\converter lyx        clyx       "python -tt $$s/lyx2lyx/lyx2lyx -c big5 -t 245 $$i > $$o"     ""
+\converter lyx        jlyx       "python -tt $$s/lyx2lyx/lyx2lyx -c euc_jp -t 245 $$i > $$o"   ""
+\converter lyx        klyx       "python -tt $$s/lyx2lyx/lyx2lyx -c euc_kr -t 245 $$i > $$o"   ""
+\converter clyx       lyx        "python -tt $$s/lyx2lyx/lyx2lyx -c big5 $$i > $$o"    ""
+\converter jlyx       lyx        "python -tt $$s/lyx2lyx/lyx2lyx -c euc_jp $$i > $$o"  ""
+\converter klyx       lyx        "python -tt $$s/lyx2lyx/lyx2lyx -c euc_kr $$i > $$o"  ""
 ''')
 
 
@@ -543,7 +549,7 @@ def processLayoutFile(file, bool_docbook, bool_linuxdoc):
     '''
     classname = file.split(os.sep)[-1].split('.')[0]
     # return ('LaTeX', '[a,b]', 'a', ',b,c', 'article') for \DeclareLaTeXClass[a,b,c]{article}
-    p = re.compile(r'\Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}')
+    p = re.compile(r'\Declare(LaTeX|DocBook|LinuxDoc)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}')
     for line in open(file).readlines():
         res = p.search(line)
         if res != None: