- # run latex on chklatex.ltx and check result
- if cmdOutput(LATEX + ' chklatex.ltx').find('ThisIsLaTeX2e') != -1:
- # valid latex2e
- return LATEX
- else:
- print "Latex not usable (not LaTeX2e) "
- # remove temporary files
- removeFiles(['chklatex.ltx', 'chklatex.log'])
- return ''
-
-
-def checkFormatEntries():
- ''' Check all formats (\Format entries) '''
- checkProg('a Tgif viewer and editor', ['tgif'],
- rc_entry = [ r'\Format tgif obj Tgif "" "%%" "%%"'])
- #
- checkProg('a FIG viewer and editor', ['xfig'],
- rc_entry = [ r'\Format fig fig FIG "" "%%" "%%"'] )
- #
- checkProg('a Grace viewer and editor', ['xmgrace'],
- rc_entry = [ r'\Format agr agr Grace "" "%%" "%%"'] )
- #
- checkProg('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'],
- rc_entry = [ r'\Format fen fen FEN "" "%%" "%%"' ])
- #
- path, iv = checkProg('a raster image viewer', ['xv', 'kview', 'gimp'])
- path, ie = checkProg('a raster image editor', ['gimp'])
- addToRC(r'''\Format bmp bmp BMP "" "%s" "%s"
-\Format gif gif GIF "" "%s" "%s"
-\Format jpg jpg JPEG "" "%s" "%s"
-\Format pbm pbm PBM "" "%s" "%s"
-\Format pgm pgm PGM "" "%s" "%s"
-\Format png png PNG "" "%s" "%s"
-\Format ppm ppm PPM "" "%s" "%s"
-\Format tiff tif TIFF "" "%s" "%s"
-\Format xbm xbm XBM "" "%s" "%s"
-\Format xpm xpm XPM "" "%s" "%s"''' % \
- (iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie) )
- #
- checkProg('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
- 'nedit', 'gedit', 'notepad'],
- rc_entry = [ r'''\Format asciichess asc "Plain text (chess output)" "" "" "%%"
-\Format asciiimage asc "Plain text (image)" "" "" "%%"
-\Format asciixfig asc "Plain text (Xfig output)" "" "" "%%"
-\Format dateout tmp "date (output)" "" "" "%%"
-\Format docbook sgml DocBook B "" "%%"
-\Format docbook-xml xml "Docbook (XML)" "" "" "%%"
-\Format literate nw NoWeb N "" "%%"
-\Format latex tex "LaTeX (plain)" L "" "%%"
-\Format linuxdoc sgml LinuxDoc x "" "%%"
-\Format pdflatex tex "LaTeX (pdflatex)" "" "" "%%"
-\Format text txt "Plain text" a "" "%%"
-\Format textparagraph txt "Plain text (paragraphs)" "" "" "%%"''' ])
- #
- #checkProg('a Postscript interpreter', ['gs'],
- # rc_entry = [ r'\ps_command "%%"' ])
- checkProg('a Postscript previewer', ['gv', 'ghostview -swap', 'kghostview'],
- rc_entry = [ r'''\Format eps eps EPS "" "%%" ""
-\Format ps ps Postscript t "%%" ""''' ])
- #
- checkProg('a PDF previewer', ['acrobat', 'acroread', 'gv', 'ghostview', \
- 'xpdf', 'kpdf', 'kghostview'],
- rc_entry = [ r'''\Format pdf pdf "PDF (ps2pdf)" P "%%" ""
-\Format pdf2 pdf "PDF (pdflatex)" F "%%" ""
-\Format pdf3 pdf "PDF (dvipdfm)" m "%%" ""''' ])
- #
- checkProg('a DVI previewer', ['xdvi', 'kdvi'],
- rc_entry = [ r'\Format dvi dvi DVI D "%%" ""' ])
- #
- checkProg('a HTML previewer', ['mozilla file://$$p$$i', 'netscape'],
- rc_entry = [ r'\Format html html HTML H "%%" ""' ])
- #
- # entried that do not need checkProg
- addToRC(r'''\Format date "" "date command" "" "" ""
-\Format fax "" Fax "" "" ""
-\Format lyx lyx LyX "" "" ""
-\Format lyx13x lyx13 "LyX 1.3.x" "" "" ""
-\Format lyxpreview lyxpreview "LyX Preview" "" "" ""
-\Format pdftex pdftex_t PDFTEX "" "" ""
-\Format program "" Program "" "" ""
-\Format pstex pstex_t PSTEX "" "" ""
-\Format sxw sxw "OpenOffice.Org Writer" O "" ""
-\Format word doc "MS Word" W "" ""
-\Format wordhtml html "MS Word (HTML)" "" "" ""
+ # run latex on chklatex.ltx and check result
+ if cmdOutput(LATEX + ' chklatex.ltx').find('ThisIsLaTeX2e') != -1:
+ # valid latex2e
+ return LATEX
+ else:
+ print "Latex not usable (not LaTeX2e) "
+ # remove temporary files
+ removeFiles(['chklatex.ltx', 'chklatex.log'])
+ return ''
+
+
+def checkFormatEntries(dtl_tools):
+ ''' Check all formats (\Format entries) '''
+ checkViewer('a Tgif viewer and editor', ['tgif'],
+ rc_entry = [r'\Format tgif obj Tgif "" "%%" "%%" "vector"'])
+ #
+ checkViewer('a FIG viewer and editor', ['xfig'],
+ rc_entry = [r'\Format fig fig FIG "" "%%" "%%" "vector"'])
+ #
+ checkViewer('a Grace viewer and editor', ['xmgrace'],
+ 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 "" "%%" "%%" ""'])
+ #
+ 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 pbm pbm PBM "" "%s" "%s" ""
+\Format pgm pgm PGM "" "%s" "%s" ""
+\Format png png PNG "" "%s" "%s" ""
+\Format ppm ppm PPM "" "%s" "%s" ""
+\Format tiff tif TIFF "" "%s" "%s" ""
+\Format xbm xbm XBM "" "%s" "%s" ""
+\Format xpm xpm XPM "" "%s" "%s" ""''' % \
+ (iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie) )
+ #
+ checkViewer('a text editor', ['sensible-editor', 'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
+ 'nedit', 'gedit', 'notepad'],
+ rc_entry = [r'''\Format asciichess asc "Plain text (chess output)" "" "" "%%" ""
+\Format asciiimage asc "Plain text (image)" "" "" "%%" ""
+\Format asciixfig asc "Plain text (Xfig output)" "" "" "%%" ""
+\Format dateout tmp "date (output)" "" "" "%%" ""
+\Format docbook sgml DocBook B "" "%%" "document"
+\Format docbook-xml xml "Docbook (XML)" "" "" "%%" "document"
+\Format dot dot "Graphviz Dot" "" "" "%%" "vector"
+\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"
+\Format text txt "Plain text" a "" "%%" "document"
+\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, Join Lines" "" "" "%%" "document"''' ])
+ #
+ checkViewer('a BibTeX editor', ['sensible-editor', 'jabref', 'JabRef', \
+ 'pybliographic', 'bibdesk', 'gbib', 'kbib', \
+ 'kbibtex', 'sixpack', 'bibedit', 'tkbibtex' \
+ 'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
+ 'nedit', 'gedit', 'notepad'],
+ rc_entry = [r'''\Format bibtex bib "BibTeX" "" "" "%%" ""''' ])
+ #
+ #checkProg('a Postscript interpreter', ['gs'],
+ # rc_entry = [ r'\ps_command "%%"' ])
+ checkViewer('a Postscript previewer', ['kghostview', 'evince', 'gv', 'ghostview -swap'],
+ rc_entry = [r'''\Format eps eps EPS "" "%%" "" "vector"
+\Format ps ps Postscript t "%%" "" "document,vector"'''])
+ #
+ checkViewer('a PDF previewer', ['kpdf', 'evince', 'kghostview', 'xpdf', 'acrobat', 'acroread', \
+ 'gv', 'ghostview'],
+ 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,vector"'])
+ if dtl_tools:
+ # Windows only: DraftDVI
+ addToRC(r'\Format dvi2 dvi DraftDVI "" "" "" "vector"')
+ #
+ 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"'])
+ #
+ checkViewer('an OpenDocument viewer', ['oowriter'],
+ rc_entry = [r'\Format odt odt OpenDocument "" "%%" "%%" "document,vector"'])
+ #
+ # entried that do not need checkProg
+ addToRC(r'''\Format date "" "date command" "" "" "" ""
+\Format csv csv "Table (CSV)" "" "" "" "document"
+\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 lyx15x lyx15 "LyX 1.5.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 pstex pstex_t PSTEX "" "" "" ""
+\Format rtf rtf "Rich Text Format" "" "" "" "document,vector"
+\Format sxw sxw "OpenOffice.Org (sxw)" "" "" "" "document,vector"
+\Format wmf wmf "Windows Metafile" "" "" "" "vector"
+\Format emf emf "Enhanced Metafile" "" "" "" "vector"
+\Format word doc "MS Word" W "" "" "document,vector"
+\Format wordhtml html "HTML (MS Word)" "" "" "" "document"