X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure.py;h=872e2ac50d2d064837ea07c4459770bcc6f310f0;hb=653376087d4107e127d577d6a4f29351a9d46b05;hp=c97af47d660f9a9de32757aa6cf2d466d61a2c0f;hpb=580fa7ee3bdfe1191e2d6b9ea884afae5f97a323;p=lyx.git diff --git a/lib/configure.py b/lib/configure.py index c97af47d66..872e2ac50d 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -263,30 +263,34 @@ def checkProgAlternatives(description, progs, rc_entry = [], alt_rc_entry = [], def addAlternatives(rcs, alt_type): ''' Returns a \\prog_alternatives string to be used as an alternative - rc entry. + rc entry. alt_type can be a string or a list of strings. ''' r = re.compile(r'\\Format (\S+).*$') m = None alt = '' - alt_token = '\\%s_alternatives ' % alt_type + alt_token = '\\%s_alternatives ' + if isinstance(alt_type, str): + alt_tokens = [alt_token % alt_type] + else: + alt_tokens = map(lambda s: alt_token % s, alt_type) for idxx in range(len(rcs)): if len(rcs) == 1: m = r.match(rcs[0]) if m: - alt = alt_token + m.group(1) + " %%" + alt = '\n'.join([s + m.group(1) + " %%" for s in alt_tokens]) elif len(rcs) > 1: m = r.match(rcs[idxx]) if m: if idxx > 0: alt += '\n' - alt += alt_token + m.group(1) + " %%" + alt += '\n'.join([s + m.group(1) + " %%" for s in alt_tokens]) return alt def listAlternatives(progs, alt_type, rc_entry = []): ''' Returns a list of \\prog_alternatives strings to be used as alternative - rc entries. + rc entries. alt_type can be a string or a list of strings. ''' if len(rc_entry) > 1 and len(rc_entry) != len(progs) + 1: logger.error("rc entry should have one item or item for each prog and not_found.") @@ -332,8 +336,8 @@ def checkEditorNoRC(description, progs, rc_entry = [], path = []): def checkViewerEditor(description, progs, rc_entry = [], path = []): ''' The same as checkProgAlternatives, but for viewers and editors ''' - checkEditorNoRC(description, progs, rc_entry, path) - return checkViewer(description, progs, rc_entry, path) + alt_rc_entry = listAlternatives(progs, ['editor', 'viewer'], rc_entry) + return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, path, not_found = 'auto') def checkDTLtools(): @@ -426,7 +430,7 @@ def checkLuatex(): logger.info(msg + ' yes') addToRC(r'\converter luatex pdf5 "%s" "latex=lualatex"' % LUATEX) if DVILUATEX != '': - addToRC(r'\converter luatex dvi3 "%s" "latex=lualatex"' % DVILUATEX) + addToRC(r'\converter luatex dvi3 "%s" "latex=dvilualatex"' % DVILUATEX) # remove temporary files removeFiles(['luatest.tex', 'luatest.log', 'luatest.aux', 'luatest.pdf']) @@ -504,7 +508,7 @@ def checkFormatEntries(dtl_tools): \Format asciixfig asc "Plain text (Xfig output)" "" "" "%%" "" \Format dateout tmp "date (output)" "" "" "%%" "" \Format docbook sgml DocBook B "" "%%" "document,menu=export" -\Format docbook-xml xml "Docbook (XML)" "" "" "%%" "document,menu=export" +\Format docbook-xml xml "DocBook (XML)" "" "" "%%" "document,menu=export" \Format dot dot "Graphviz Dot" "" "" "%%" "vector" \Format platex tex "LaTeX (pLaTeX)" "" "" "%%" "document,menu=export" \Format literate nw NoWeb N "" "%%" "document,menu=export" @@ -542,7 +546,7 @@ def checkFormatEntries(dtl_tools): # rc_entry = [ r'\ps_command "%%"' ]) checkViewer('a Postscript previewer', ['kghostview', 'okular', 'evince', 'gv', 'ghostview -swap'], rc_entry = [r'''\Format eps eps EPS "" "%%" "" "vector" -\Format ps ps Postscript t "%%" "" "document,vector"''']) +\Format ps ps Postscript t "%%" "" "document,vector,menu=export"''']) # 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', \ 'gv', 'ghostview'], @@ -582,6 +586,7 @@ def checkFormatEntries(dtl_tools): \Format lyx14x 14.lyx "LyX 1.4.x" "" "" "" "document" \Format lyx15x 15.lyx "LyX 1.5.x" "" "" "" "document" \Format lyx16x 16.lyx "LyX 1.6.x" "" "" "" "document,menu=export" +\Format lyx20x 20.lyx "LyX 2.0.x" "" "" "" "document,menu=export" \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" @@ -898,6 +903,7 @@ def checkConverterEntries(): \converter lyx lyx14x "python -tt $$s/lyx2lyx/lyx2lyx -t 245 $$i > $$o" "" \converter lyx lyx15x "python -tt $$s/lyx2lyx/lyx2lyx -t 276 $$i > $$o" "" \converter lyx lyx16x "python -tt $$s/lyx2lyx/lyx2lyx -t 345 $$i > $$o" "" +\converter lyx lyx20x "python -tt $$s/lyx2lyx/lyx2lyx -t 413 $$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" ""