Commits

Anonymous committed e7993c1

- When latex is run with --debug or --v, display the latex warnings.
- Fixed bug in determining whether to re-run latex

git-svn-id: https://epydoc.svn.sourceforge.net/svnroot/epydoc/trunk/epydoc@1807dcb71dd9-490e-0410-a59b-d6317640170d

Comments (0)

Files changed (1)

src/epydoc/cli.py

                 options.pdfdriver = 'latex'
     log.info('%r pdfdriver selected' % options.pdfdriver)
     
-    from epydoc.docwriter.latex import LatexWriter
+    from epydoc.docwriter.latex import LatexWriter, show_latex_warnings
     latex_writer = LatexWriter(docindex, **options.__dict__)
-    latex_writer.write(latex_target)
+    try:
+        latex_writer.write(latex_target)
+    except IOError, e:
+        log.error(e)
+        log.end_progress()
+        log.start_progress()
+        log.end_progress()
+        return
     log.end_progress()
 
     # Decide how many steps we need to go through.
                 # The third pass is only necessary if the second pass
                 # changed what page some things are on.
                 running = latex_command
-                if _RERUN_LATEX_RE.match(out):
+                if _RERUN_LATEX_RE.search(out):
                     log.progress(step/steps, '%s (Third pass)' % LaTeX)
                     out, err = run_subprocess('%s api.tex' % latex_command)
                     
                 # A fourth path should (almost?) never be necessary.
                 running = latex_command
-                if _RERUN_LATEX_RE.match(out):
+                if _RERUN_LATEX_RE.search(out):
                     log.progress(step/steps, '%s (Fourth pass)' % LaTeX)
-                    run_subprocess('%s api.tex' % latex_command)
+                    out, err = run_subprocess('%s api.tex' % latex_command)
                 step += 1
 
+                # Show the output, if verbosity is high:
+                if options.verbosity > 2 or epydoc.DEBUG:
+                    show_latex_warnings(out)
+
             # If requested, convert to postscript.
             if ('ps' in options.actions or
                 ('pdf' in options.actions and options.pdfdriver=='latex')):