#! /usr/bin/env python
+# -*- coding: utf-8 -*-
#
# file configure.py
# This file is part of LyX, the document processor.
# \author Bo Peng
# Full author contact details are available in file CREDITS.
-# This is an experimental version of the configure script, written
-# in Python.
-
import sys, os, re, shutil, glob
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" ""
\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 (paragraphs)" "" "" "%%" "document"''' ])
+\Format textparagraph txt "Plain Text, Join Lines" "" "" "%%" "document"''' ])
#
#checkProg('a Postscript interpreter', ['gs'],
# rc_entry = [ r'\ps_command "%%"' ])
# Windows only: DraftDVI
addToRC(r'\Format dvi2 dvi DraftDVI "" "" "document,vector"')
#
- checkViewer('a 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'],
+ rc_entry = [r'\Format noteedit not Noteedit "" "%%" "%%" "vector"'])
+ #
# entried that do not need checkProg
addToRC(r'''\Format date "" "date command" "" "" "" ""
\Format fax "" Fax "" "" "" "document"
\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 "" "" "" ""
\Format sxw sxw "OpenOffice.Org Writer" O "" "" "document,vector"
\Format wmf wmf "Windows Meta File" "" "" "" "vector"
\Format word doc "MS Word" W "" "" "document,vector"
-\Format wordhtml html "MS Word (HTML)" "" "" "" "document"
+\Format wordhtml html "HTML (MS Word)" "" "" "" "document"
''')
checkProg('a Noweb -> LaTeX converter', ['noweave -delay -index $$i > $$o'],
rc_entry = [ r'\converter literate latex "%%" ""' ])
#
- checkProg('a HTML -> LaTeX converter', ['html2latex $$i'],
+ checkProg('an HTML -> LaTeX converter', ['html2latex $$i'],
rc_entry = [ r'\converter html latex "%%" ""' ])
#
- checkProg('a MSWord -> LaTeX converter', ['wvCleanLatex $$i $$o'],
+ checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'],
rc_entry = [ r'\converter word latex "%%" ""' ])
#
checkProg('a LaTeX -> MS Word converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
checkProg('a WMF -> EPS converter', ['wmf2eps -o $$o $$i'],
rc_entry = [ r'\converter wmf eps "%%" ""', ''])
#
- checkProg('a EPS -> PDF converter', ['epstopdf'],
+ checkProg('an EPS -> PDF converter', ['epstopdf'],
rc_entry = [ r'\converter eps pdf "epstopdf --outfile=$$o $$i" ""', ''])
#
+ # 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" ""
else:
print '+ found LilyPond, but could not extract version number.'
#
+ checkProg('a Noteedit -> LilyPond converter', ['noteedit --export-lilypond $$i'],
+ rc_entry = [ r'\converter noteedit lilypond "%%" ""', ''])
+ #
# 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" ""
''')
''' entries other than Format and Converter '''
checkProg('a *roff formatter', ['groff', 'nroff'],
rc_entry = [
- r'\ascii_roff_command "groff -t -Tlatin1 $$FName"',
- r'\ascii_roff_command "tbl $$FName | nroff"',
- r'\ascii_roff_command ""' ])
+ r'\plaintext_roff_command "groff -t -Tlatin1 $$FName"',
+ r'\plaintext_roff_command "tbl $$FName | nroff"',
+ r'\plaintext_roff_command ""' ])
checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
rc_entry = [ r'\chktex_command "%%"' ])
checkProg('a spellchecker', ['ispell'],
def processLayoutFile(file, bool_docbook, bool_linuxdoc):
''' process layout file and get a line of result
- Declear line are like this: (article.layout, scrbook.layout, svjog.layout)
+ Declare lines look like this: (article.layout, scrbook.layout, svjog.layout)
\DeclareLaTeXClass{article}
\DeclareLaTeXClass[scrbook]{book (koma-script)}
"svjog" "svjour" "article (Springer - svjour/jog)" "false"
'''
classname = file.split(os.sep)[-1].split('.')[0]
- # return ('LaTeX', '[a,b]', 'a', ',b,c', 'article') for \DeclearLaTeXClass[a,b,c]{article}
- p = re.compile(r'\Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}')
+ # return ('LaTeX', '[a,b]', 'a', ',b,c', 'article') for \DeclareLaTeXClass[a,b,c]{article}
+ p = re.compile(r'\Declare(LaTeX|DocBook|LinuxDoc)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}')
for line in open(file).readlines():
res = p.search(line)
if res != None:
if opt == None:
opt = classname
return '"%s" "%s" "%s" "%s"\n' % (classname, opt, desc, avai)
- print "Layout file without \DeclearXXClass line. "
+ print "Layout file without \DeclareXXClass line. "
sys.exit(2)