From 3607d366f2026458d9dc6b31af181d65900b1b73 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Nov 2008 08:43:13 +0100 Subject: [PATCH] Allow silencing all warnings with -Q. --- sphinx/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 2af1de31a..ed6386d4e 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -42,6 +42,7 @@ Options: -b -- builder to use; default is html -A -- pass a value into the templates, for HTML builder -N -- do not do colored output -q -- no output on stdout, just warnings on stderr + -Q -- no output at all, not even warnings -P -- run Pdb on exception Modi: * without -a and without filenames, write new and changed files. @@ -89,6 +90,7 @@ def main(argv=sys.argv): buildername = all_files = None freshenv = use_pdb = False status = sys.stdout + warning = sys.stderr confoverrides = {} htmlcontext = {} doctreedir = path.join(outdir, '.doctrees') @@ -138,13 +140,16 @@ def main(argv=sys.argv): freshenv = True elif opt == '-q': status = StringIO() + elif opt == '-Q': + status = StringIO() + warning = StringIO() elif opt == '-P': use_pdb = True confoverrides['html_context'] = htmlcontext try: app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername, - confoverrides, status, sys.stderr, freshenv) + confoverrides, status, warning, freshenv) app.build(all_files, filenames) except KeyboardInterrupt: if use_pdb: