Sphinx build script#
This is Sage’s version of the sphinx-build
script. We redirect stdout
and
stderr
to our own logger, and remove some unwanted chatter.
- class sage_docbuild.sphinxbuild.SageSphinxLogger(stream, prefix)#
Bases:
object
This implements the file object interface to serve as
sys.stdout
/sys.stderr
replacement.- ansi_color = re.compile('\\x1b\\[[0-9;]*m')#
- ansi_reset = re.compile('\\x1b\\[39;49;00m')#
- close()#
- closed = False#
- encoding = None#
- flush()#
- isatty()#
- mode = 'w'#
- name = '<log>'#
- newlines = None#
- prefix_len = 9#
- raise_errors()#
Raise an exceptions if any errors have been found while parsing the Sphinx output.
EXAMPLES:
sage: from sys import stdout sage: from sage_docbuild.sphinxbuild import SageSphinxLogger sage: logger = SageSphinxLogger(stdout, "doctesting") sage: logger._log_line("This is a SEVERE error\n") [doctestin] This is a SEVERE error sage: logger.raise_errors() Traceback (most recent call last): ... OSError: This is a SEVERE error
- softspace = 0#
- write(str)#
- writelines(sequence)#
- sage_docbuild.sphinxbuild.runsphinx()#
- sage_docbuild.sphinxbuild.term_width_line(text)#