Skip to content

Commit

Permalink
Re #7081. Fixed bug in error messages of eqnparser.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Jun 20, 2013
1 parent bf2924d commit 5559809
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Code/Mantid/docs/qtassistant/eqnparser.py
Expand Up @@ -215,8 +215,10 @@ def _compileDVI(self):
Compiles the Tex file into a DVI. If there's an error, raise it.
"""
self._logger.info("Generating dvi file")
if self._latex is None:
raise RuntimeError("Failed to specify latex executable")
if not os.path.exists(self._latex):
raise RuntimeError("latex executable ('%s') does not exist" % LATEX)
raise RuntimeError("latex executable ('%s') does not exist" % self._latex)

# run latex
cmd = [self._latex, self.texfile]
Expand Down Expand Up @@ -263,8 +265,10 @@ def _createPNG(self):
Encodes the original latex as an HTML comment.
"""
self._logger.info("Generating png file")
if self._dvipng is None:
raise RuntimeError("Failed to specify dvipng executable")
if not os.path.exists(self._dvipng):
raise RuntimeError("dvipng executable ('%s') does not exist" % DVIPNG)
raise RuntimeError("dvipng executable ('%s') does not exist" % self._dvipng)

# this command works on RHEL6
cmd = [self._dvipng, '-Ttight','-D120','-z9','-bg Transparent','--strict',
Expand All @@ -278,7 +282,7 @@ def _createPNG(self):
if retcode != 0:
print ' '.join(cmd)
print output
raise RuntimeError()#"'%s' returned %d" % (" ".join(cmd), retcode))
raise RuntimeError("'%s' returned %d" % (" ".join(cmd), retcode))

# verify the png file exists
if not os.path.exists(self.pngfile):
Expand Down

0 comments on commit 5559809

Please sign in to comment.