diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-06-12 13:28:55 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-06-12 13:28:55 +0200 |
commit | 0380bd42bbcb0b7e807512cd34803936460e04b5 (patch) | |
tree | 914cac3b350f55f7f0b49e53b3d152caf86f8201 | |
parent | 32b44a3924db4986dd838d9aac213f9006c33215 (diff) | |
download | pep8-0380bd42bbcb0b7e807512cd34803936460e04b5.tar.gz |
Reserve the FileReport for the script mode; honour the quiet=True argument when using the library.
-rwxr-xr-x | pep8.py | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1521,6 +1521,12 @@ class StyleGuide(object): if 'paths' in options_dict: self.paths = options_dict['paths'] + if not options.reporter: + if options.quiet: + options.reporter = BasicReport + else: + options.reporter = StandardReport + for index, value in enumerate(options.exclude): options.exclude[index] = value.rstrip('/') if not options.select: @@ -1845,6 +1851,7 @@ def process_options(arglist=None): help='set the error format [default|pylint|<custom>]') options, args = parser.parse_args(arglist) + options.reporter = None if options.show_pep8: options.repeat = False if options.testsuite: @@ -1856,6 +1863,8 @@ def process_options(arglist=None): else: parser.error('input not specified') options = read_config(options, args, arglist, parser) + if options.quiet == 1 and arglist is None: + options.reporter = FileReport options.exclude = options.exclude.split(',') if options.filename: @@ -1871,13 +1880,6 @@ def process_options(arglist=None): # (for doctest and testsuite, all checks are required) options.ignore = DEFAULT_IGNORE.split(',') - if not options.quiet: - options.reporter = StandardReport - elif options.quiet == 1: - options.reporter = FileReport - else: - options.reporter = BasicReport - return options, args |