Author: roidelapluie Date: 2007-07-20 02:05:38 +0200 (Fri, 20 Jul 2007) New Revision: 8416
Modified: trunk/src/features_window.py Log: Beter handling of LaTeX in feature window
Modified: trunk/src/features_window.py =================================================================== --- trunk/src/features_window.py 2007-07-19 23:36:25 UTC (rev 8415) +++ trunk/src/features_window.py 2007-07-20 00:05:38 UTC (rev 8416) @@ -87,7 +87,7 @@ _('Requires compilation of the idle module from Gajim sources.')), _('LaTeX'): (self.latex_available, _('Transform LaTeX espressions between $$ $$.'), - _('Requires latex, dvips and imagemagick. You have to set 'use_latex' to True in the Advanced Configuration Editor.'), + _('Requires texlive-latex-base, dvips and imagemagick. You have to set 'use_latex' to True in the Advanced Configuration Editor.'), _('Feature not available under Windows.')), }
@@ -244,17 +244,26 @@ file.write(texstr) file.flush() file.close() - p = Popen(['latex', '--interaction=nonstopmode', tmpfile + '.tex'], - cwd=gettempdir()) - exitcode = p.wait() - if exitcode == 0: - p = Popen(['dvips', '-E', '-o', tmpfile + '.ps', tmpfile + '.dvi'], + try: + p = Popen(['latex', '--interaction=nonstopmode', tmpfile + '.tex'], cwd=gettempdir()) exitcode = p.wait() + except: + exitcode = 1 if exitcode == 0: - p = Popen(['convert', tmpfile + '.ps', tmpfile + '.png'], - cwd=gettempdir()) - exitcode = p.wait() + try: + p = Popen(['dvips', '-E', '-o', tmpfile + '.ps', tmpfile + '.dvi'], + cwd=gettempdir()) + exitcode = p.wait() + except: + exitcode = 1 + if exitcode == 0: + try: + p = Popen(['convert', tmpfile + '.ps', tmpfile + '.png'], + cwd=gettempdir()) + exitcode = p.wait() + except: + exitcode = 1 extensions = [".tex", ".log", ".aux", ".dvi", ".ps", ".png"] for ext in extensions: try: