diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-08-04 23:49:07 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-08-04 23:49:07 (GMT) |
commit | 236b9ef60de3baab79ff388f789d13fa9b0baa72 (patch) | |
tree | d816ebd7c8e939a176e9d7720352c0277fbc792a /scripts | |
parent | 26985ff913995e4d0305ab60400687dfbc6b13c6 (diff) |
Fix pylint output parsing and error handling.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/check.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/check.py b/scripts/check.py index 77fa4eb..c222392 100644 --- a/scripts/check.py +++ b/scripts/check.py @@ -1,4 +1,5 @@ import os +import sys from optparse import make_option import random import subprocess @@ -37,11 +38,12 @@ class cmd_check(Command): def run_pylint(self, args): p = subprocess.Popen([ 'pylint' ] + args, stdout=subprocess.PIPE) + stdout, stderr = p.communicate() - output = p.stdout.read() - print output + sys.stdout.write(stdout) + sys.stdout.flush() - return len(output.strip()) > 0 + return len(stdout.strip()) == 0 def lint(self, module): return self.run_pylint([module, '--rcfile=%s' % pylintrc_path]) @@ -64,7 +66,7 @@ class cmd_check(Command): return result def run(self, config, options, args): - result = True + results = [] self.start_xvfb(options.xvfb_port) @@ -72,13 +74,13 @@ class cmd_check(Command): sugar_path = os.path.join(config.prefix, 'share', 'sugar') - result &= self.lint_path(os.path.join(sugar_path, 'shell')) - result &= self.lint_path(os.path.join(sugar_path, 'service')) + results.append(self.lint_path(os.path.join(sugar_path, 'shell'))) + results.append(self.lint_path(os.path.join(sugar_path, 'service'))) print 'Pylint the sugar module...' - result &= self.lint('sugar') + results.append(self.lint('sugar')) - return result + return False in results register_command(cmd_check) |