X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure.py;h=29c4bbc5e01713d0fbcb6b4eef29a43c8fef3f16;hb=21e8d10d975b37882d5f3fb7862a3fcb5616640d;hp=3599b98ae007aa9896fc06564d949fea68c63e71;hpb=b098503fafbbb5174675577079efb14051475131;p=lyx.git diff --git a/lib/configure.py b/lib/configure.py index 3599b98ae0..29c4bbc5e0 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -220,13 +220,13 @@ def checkLatex(): def checkFormatEntries(): ''' Check all formats (\Format entries) ''' checkViewer('a Tgif viewer and editor', ['tgif'], - rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%" ""']) + rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%" "vector"']) # checkViewer('a FIG viewer and editor', ['xfig'], - rc_entry = [r'\Format fig fig FIG "" "%%" "%%" ""']) + rc_entry = [r'\Format fig fig FIG "" "%%" "%%" "vector"']) # checkViewer('a Grace viewer and editor', ['xmgrace'], - rc_entry = [r'\Format agr agr Grace "" "%%" "%%" ""']) + rc_entry = [r'\Format agr agr Grace "" "%%" "%%" "vector"']) # checkViewer('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'], rc_entry = [r'\Format fen fen FEN "" "%%" "%%" ""']) @@ -254,6 +254,7 @@ def checkFormatEntries(): \Format docbook sgml DocBook B "" "%%" "document" \Format docbook-xml xml "Docbook (XML)" "" "" "%%" "document" \Format literate nw NoWeb N "" "%%" "document" +\Format lilypond ly "LilyPond music" "" "" "%%" "vector" \Format latex tex "LaTeX (plain)" L "" "%%" "document" \Format linuxdoc sgml LinuxDoc x "" "%%" "document" \Format pdflatex tex "LaTeX (pdflatex)" "" "" "%%" "document" @@ -266,22 +267,22 @@ def checkFormatEntries(): #checkProg('a Postscript interpreter', ['gs'], # rc_entry = [ r'\ps_command "%%"' ]) checkViewer('a Postscript previewer', ['gv', 'ghostview -swap', 'kghostview'], - rc_entry = [r'''\Format eps eps EPS "" "%%" "" "" -\Format ps ps Postscript t "%%" "" "document"''']) + rc_entry = [r'''\Format eps eps EPS "" "%%" "" "vector" +\Format ps ps Postscript t "%%" "" "document,vector"''']) # checkViewer('a PDF previewer', ['acrobat', 'acroread', 'gv', 'ghostview', \ 'xpdf', 'kpdf', 'kghostview'], - rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document" -\Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document" -\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document"''']) + rc_entry = [r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" "" "document,vector" +\Format pdf2 pdf "PDF (pdflatex)" F "%%" "" "document,vector" +\Format pdf3 pdf "PDF (dvipdfm)" m "%%" "" "document,vector"''']) # checkViewer('a DVI previewer', ['xdvi', 'kdvi'], - rc_entry = [r'\Format dvi dvi DVI D "%%" "" "document"']) + rc_entry = [r'\Format dvi dvi DVI D "%%" "" "document,vector"']) if ((os.name == 'nt' or sys.platform == 'cygwin') and checkProg('DVI to DTL converter', ['dv2dt']) != ['', ''] and checkProg('DTL to DVI converter', ['dt2dv']) != ['', '']): # Windows only: DraftDVI - addToRC(r'\Format dvi2 dvi DraftDVI "" "" "document"') + addToRC(r'\Format dvi2 dvi DraftDVI "" "" "document,vector"') # checkViewer('a HTML previewer', ['mozilla file://$$p$$i', 'netscape'], rc_entry = [r'\Format html html HTML H "%%" "" "document"']) @@ -295,10 +296,10 @@ def checkFormatEntries(): \Format pdftex pdftex_t PDFTEX "" "" "" "" \Format program "" Program "" "" "" "" \Format pstex pstex_t PSTEX "" "" "" "" -\Format rtf rtf "Rich Text Format" "" "" "" "document" -\Format sxw sxw "OpenOffice.Org Writer" O "" "" "document" -\Format wmf wmf "Windows Meta File" "" "" "" "" -\Format word doc "MS Word" W "" "" "document" +\Format rtf rtf "Rich Text Format" "" "" "" "document,vector" +\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" ''') @@ -408,6 +409,24 @@ def checkConverterEntries(): 'latex2html -no_subdir -split 0 -show_section_numbers $$i', 'hevea -s $$i'], rc_entry = [ r'\converter latex html "%%" "originaldir,needaux"' ]) # + path, lilypond = checkProg('a LilyPond -> ESP/PDF/PNG converter', ['lilypond']) + if (lilypond != ''): + version_string = cmdOutput("lilypond --version") + match = re.match('GNU LilyPond (\S+)', version_string) + if match: + version_number = match.groups()[0] + version = version_number.split('.') + if int(version[0]) > 2 or (len(version) > 1 and int(version[0]) == 2 and int(version[1]) >= 6): + addToRC(r'''\converter lilypond eps "lilypond -b eps --ps $$i" "" +\converter lilypond png "lilypond -b eps --png $$i" ""''') + if int(version[0]) > 2 or (len(version) > 1 and int(version[0]) == 2 and int(version[1]) >= 9): + addToRC(r'\converter lilypond pdf "lilypond -b eps --pdf $$i" ""') + print '+ found LilyPond version %s.' % version_number + else: + print '+ found LilyPond, but version %s is too old.' % version_number + else: + print '+ found LilyPond, but could not extract version number.' + # # FIXME: no rc_entry? comment it out # checkProg('Image converter', ['convert $$i $$o']) #