In configure.py, DTL tools are checked for in two distinct places. The attached patches fix this. Ok to apply to both 1.4.x and trunk?
-- Enrico
Index: lib/configure.py =================================================================== --- lib/configure.py (revision 15890) +++ lib/configure.py (working copy) @@ -179,13 +179,23 @@ def checkViewer(description, progs, rc_e return checkProg(description, progs, rc_entry, path, not_found = 'auto') -def checkLatex(): - ''' Check latex, return lyx_check_config ''' +def checkDTLtools(): + ''' Check whether DTL tools are available (Windows only) ''' # Find programs! Returned path is not used now 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 + dtl_tools = 'true' + else: + dtl_tools = 'false' + return dtl_tools + + +def checkLatex(dtl_tools): + ''' Check latex, return lyx_check_config ''' + if (dtl_tools): + # Windows only: DraftDVI converter_entry = r'''\converter latex dvi2 "%%" "latex" \converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' else: @@ -213,7 +223,7 @@ def checkLatex(): return '' -def checkFormatEntries(): +def checkFormatEntries(dtl_tools): ''' Check all formats (\Format entries) ''' checkViewer('a Tgif viewer and editor', ['tgif'], rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%"']) @@ -271,9 +281,7 @@ def checkFormatEntries(): # checkViewer('a DVI previewer', ['xdvi', 'kdvi'], rc_entry = [r'\Format dvi dvi DVI D "%%" ""']) - if ((os.name == 'nt' or sys.platform == 'cygwin') and - checkProg('DVI to DTL converter', ['dv2dt']) != ['', ''] and - checkProg('DTL to DVI converter', ['dt2dv']) != ['', '']): + if (dtl_tools): # Windows only: DraftDVI addToRC(r'\Format dvi2 dvi DraftDVI "" "" ""') # @@ -747,6 +755,7 @@ Options: setEnviron() createDirectories() windows_style_tex_paths = checkTeXPaths() + dtl_tools = checkDTLtools() ## Write the first part of outfile writeToFile(outfile, '''# This file has been automatically generated by LyX' lib/configure.py # script. It contains default settings that have been determined by @@ -756,8 +765,8 @@ Options: # override the values given here. ''') # check latex - LATEX = checkLatex() - checkFormatEntries() + LATEX = checkLatex(dtl_tools) + checkFormatEntries(dtl_tools) checkConverterEntries() (chk_linuxdoc, bool_linuxdoc, linuxdoc_cmd) = checkLinuxDoc() (chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()
Index: lib/configure.py =================================================================== --- lib/configure.py (revision 15890) +++ lib/configure.py (working copy) @@ -183,13 +183,23 @@ def checkViewer(description, progs, rc_e return checkProg(description, progs, rc_entry, path, not_found = 'auto') -def checkLatex(): - ''' Check latex, return lyx_check_config ''' +def checkDTLtools(): + ''' Check whether DTL tools are available (Windows only) ''' # Find programs! Returned path is not used now 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 + dtl_tools = 'true' + else: + dtl_tools = 'false' + return dtl_tools + + +def checkLatex(dtl_tools): + ''' Check latex, return lyx_check_config ''' + if (dtl_tools): + # Windows only: DraftDVI converter_entry = r'''\converter latex dvi2 "%%" "latex" \converter dvi2 dvi "python -tt $$s/scripts/clean_dvi.py $$i $$o" ""''' else: @@ -217,7 +227,7 @@ def checkLatex(): return '' -def checkFormatEntries(): +def checkFormatEntries(dtl_tools): ''' Check all formats (\Format entries) ''' checkViewer('a Tgif viewer and editor', ['tgif'], rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%" "vector"']) @@ -278,9 +288,7 @@ def checkFormatEntries(): # checkViewer('a DVI previewer', ['xdvi', 'kdvi'], 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']) != ['', '']): + if (dtl_tools): # Windows only: DraftDVI addToRC(r'\Format dvi2 dvi DraftDVI "" "" "document,vector"') # @@ -756,6 +764,7 @@ Options: setEnviron() createDirectories() windows_style_tex_paths = checkTeXPaths() + dtl_tools = checkDTLtools() ## Write the first part of outfile writeToFile(outfile, '''# This file has been automatically generated by LyX' lib/configure.py # script. It contains default settings that have been determined by @@ -765,8 +774,8 @@ Options: # override the values given here. ''') # check latex - LATEX = checkLatex() - checkFormatEntries() + LATEX = checkLatex(dtl_tools) + checkFormatEntries(dtl_tools) checkConverterEntries() (chk_linuxdoc, bool_linuxdoc, linuxdoc_cmd) = checkLinuxDoc() (chk_docbook, bool_docbook, docbook_cmd) = checkDocBook()