mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make WARNING the default warning prefix.
This commit is contained in:
parent
ed26bfa30e
commit
0d75f37e23
@ -134,7 +134,7 @@ class Sphinx(object):
|
||||
self.emit('build-finished', None)
|
||||
self.builder.cleanup()
|
||||
|
||||
def warn(self, message, location=None, prefix='warning: '):
|
||||
def warn(self, message, location=None, prefix='WARNING: '):
|
||||
warntext = location and '%s: %s%s\n' % (location, prefix, message) or \
|
||||
'%s%s\n' % (prefix, message)
|
||||
if self.warningiserror:
|
||||
|
@ -53,7 +53,7 @@ def test_output():
|
||||
|
||||
old_count = app._warncount
|
||||
app.warn("Bad news!")
|
||||
assert warnings.getvalue() == "warning: Bad news!\n"
|
||||
assert warnings.getvalue() == "WARNING: Bad news!\n"
|
||||
assert app._warncount == old_count + 1
|
||||
finally:
|
||||
app.cleanup()
|
||||
|
@ -38,24 +38,24 @@ html_warnfile = StringIO()
|
||||
latex_warnfile = StringIO()
|
||||
|
||||
ENV_WARNINGS = """\
|
||||
%(root)s/images.txt:9: warning: image file not readable: foo.png
|
||||
%(root)s/images.txt:23: warning: nonlocal image URI found: \
|
||||
%(root)s/images.txt:9: WARNING: image file not readable: foo.png
|
||||
%(root)s/images.txt:23: WARNING: nonlocal image URI found: \
|
||||
http://www.python.org/logo.png
|
||||
%(root)s/includes.txt:: (WARNING/2) Encoding 'utf-8' used for reading \
|
||||
included file u'wrongenc.inc' seems to be wrong, try giving an :encoding: option
|
||||
%(root)s/includes.txt:56: warning: download file not readable: nonexisting.png
|
||||
%(root)s/includes.txt:56: WARNING: download file not readable: nonexisting.png
|
||||
"""
|
||||
|
||||
HTML_WARNINGS = ENV_WARNINGS + """\
|
||||
%(root)s/images.txt:20: warning: no matching candidate for image URI u'foo.*'
|
||||
%(root)s/markup.txt:: warning: invalid index entry u''
|
||||
%(root)s/markup.txt:: warning: invalid pair index entry u''
|
||||
%(root)s/markup.txt:: warning: invalid pair index entry u'keyword; '
|
||||
%(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.*'
|
||||
%(root)s/markup.txt:: WARNING: invalid index entry u''
|
||||
%(root)s/markup.txt:: WARNING: invalid pair index entry u''
|
||||
%(root)s/markup.txt:: WARNING: invalid pair index entry u'keyword; '
|
||||
"""
|
||||
|
||||
LATEX_WARNINGS = ENV_WARNINGS + """\
|
||||
None:None: warning: no matching candidate for image URI u'foo.*'
|
||||
warning: invalid pair index entry u''
|
||||
None:None: WARNING: no matching candidate for image URI u'foo.*'
|
||||
WARNING: invalid pair index entry u''
|
||||
"""
|
||||
|
||||
HTML_XPATH = {
|
||||
|
Loading…
Reference in New Issue
Block a user