X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fconfigure.py;h=83e2ce7c0c07f6f2b74736c0e72fc1cf2650016a;hb=38c2cde0d8695ac5287bae218c4a33a2acf18ef8;hp=6c1e20a3f9afef7682aff08d91b922907964bf08;hpb=ac106bd7204cad36256eed70116f0f4447a75b30;p=lyx.git diff --git a/lib/configure.py b/lib/configure.py index 6c1e20a3f9..83e2ce7c0c 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -542,7 +542,6 @@ def checkInkscape(): def checkLatex(dtl_tools): ''' Check latex, return lyx_check_config ''' path, LATEX = checkProg('a Latex2e program', ['latex $$i', 'latex2e $$i']) - path, PPLATEX = checkProg('a DVI postprocessing program', ['pplatex $$i']) #----------------------------------------------------------------- path, PLATEX = checkProg('pLaTeX, the Japanese LaTeX', ['platex $$i']) if PLATEX: @@ -556,15 +555,12 @@ def checkLatex(dtl_tools): PLATEX = '' removeFiles(['chklatex.ltx', 'chklatex.log']) #----------------------------------------------------------------- - # use LATEX to convert from latex to dvi if PPLATEX is not available - if PPLATEX == '': - PPLATEX = LATEX if dtl_tools: # Windows only: DraftDVI addToRC(r'''\converter latex dvi2 "%s" "latex,hyperref-driver=dvips" -\converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' % PPLATEX) +\converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' % LATEX) else: - addToRC(r'\converter latex dvi "%s" "latex,hyperref-driver=dvips"' % PPLATEX) + addToRC(r'\converter latex dvi "%s" "latex,hyperref-driver=dvips"' % LATEX) # no latex if LATEX: # Check if latex is usable @@ -1238,7 +1234,7 @@ def checkOtherEntries(): rc_entry = [ r'\jbibtex_command "automatic"' ], alt_rc_entry = [ r'\jbibtex_alternatives "%%"' ]) checkProgAlternatives('available index processors', - ['texindy', 'makeindex -c -q', 'xindy'], + ['texindy $$x -t $$b.ilg', 'makeindex -c -q', 'xindy -M texindy $$x -t $$b.ilg'], rc_entry = [ r'\index_command "%%"' ], alt_rc_entry = [ r'\index_alternatives "%%"' ]) checkProg('an index processor appropriate to Japanese', @@ -1406,25 +1402,34 @@ def checkLatexConfig(check_config, bool_docbook): classname = file.split(os.sep)[-1].split('.')[0] decline = "" catline = "" - for line in open(file, 'r', encoding='utf8').readlines(): - if not empty.match(line) and line[0] != '#'[0]: - if decline == "": - logger.warning("Failed to find valid \Declare line " - "for layout file `%s'.\n\t=> Skipping this file!" % file) - nodeclaration = True - # A class, but no category declaration. Just break. + try: + for line in open(file, 'r', encoding='utf8').readlines(): + if not empty.match(line) and line[0] != '#'[0]: + if decline == "": + logger.warning("Failed to find valid \Declare line " + "for layout file `%s'.\n\t=> Skipping this file!" % file) + nodeclaration = True + # A class, but no category declaration. Just break. + break + if declare.match(line) != None: + decline = "\\TestDocClass{%s}{%s}" % (classname, line[1:].strip()) + testclasses.append(decline) + elif category.match(line) != None: + catline = ("\\DeclareCategory{%s}{%s}" + % (classname, category.match(line).groups()[0])) + testclasses.append(catline) + if catline == "" or decline == "": + continue break - if declare.match(line) != None: - decline = "\\TestDocClass{%s}{%s}" % (classname, line[1:].strip()) - testclasses.append(decline) - elif category.match(line) != None: - catline = ("\\DeclareCategory{%s}{%s}" - % (classname, category.match(line).groups()[0])) - testclasses.append(catline) - if catline == "" or decline == "": + if nodeclaration: continue - break - if nodeclaration: + except UnicodeDecodeError: + logger.warning("**************************************************\n" + "Layout file '%s'\n" + "cannot be decoded in utf-8.\n" + "Please check if the file has the correct encoding.\n" + "Skipping this file!\n" + "**************************************************" % file) continue testclasses.sort() cl = open('chklayouts.tex', 'w', encoding='utf8') @@ -1799,7 +1804,7 @@ if __name__ == '__main__': lyx_check_config = True lyx_kpsewhich = True outfile = 'lyxrc.defaults' - lyxrc_fileformat = 30 + lyxrc_fileformat = 31 rc_entries = '' lyx_keep_temps = False version_suffix = ''