Ticket #6495: trac_6495-filtering.patch

File trac_6495-filtering.patch, 1.9 KB (added by jhpalmieri, 6 years ago)
  • doc/common/custom-sphinx-build.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1360046772 28800
    # Node ID 11378629bd775ef56e6b113dfa383e3035ece158
    # Parent  f4a402fa8a9816056ae9921c75504b302ace0a46
    Modify what Sphinx output gets filtered.
    
    diff --git a/doc/common/custom-sphinx-build.py b/doc/common/custom-sphinx-build.py
    a b  
    2222sphinx.util.console.term_width_line = term_width_line
    2323
    2424
    25 
     25# useless_chatter: regular expressions to be filtered from Sphinx
     26# output.
    2627
    2728useless_chatter = (
    2829    re.compile('^$'),
     
    3132    re.compile('^Compiling a sub-document'),
    3233    re.compile('^updating environment: 0 added, 0 changed, 0 removed'),
    3334    re.compile('^looking for now-outdated files... none found'),
    34     re.compile('^no targets are out of date.'),
    3535    re.compile('^building \[.*\]: targets for 0 source files that are out of date'),
    3636    re.compile('^loading pickled environment... done'),
    3737    re.compile('^loading cross citations... done \([0-9]* citations\).')
    3838    )
    3939
     40# replacements: pairs of regular expressions and their replacements,
     41# to be applied to Sphinx output.
     42
     43replacements = ()
    4044
    4145if any('multidoc_first_pass=1' in arg for arg in sys.argv):
     46    # When building the inventory, ignore warnings about missing
     47    # citations.
    4248    useless_chatter += (
    4349        re.compile('^None:[0-9]*: WARNING: citation not found: '),
    4450        )
    45    
    46 
     51    replacements += ([re.compile('build succeeded, [0-9]+ warning[s]?.'),
     52                      'build succeeded.'], )
    4753
    4854
    4955class SageSphinxLogger(object):
     
    7581    def _log_line(self, line):
    7682        if self._filter_out(line):
    7783            return
     84        for (old, new) in replacements:
     85            line = old.sub(new, line)
    7886        line = self._prefix + ' ' + line.strip() + '\n'
    7987        if not self._color:
    8088            line = self.ansi_color.sub('', line)