diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-08-09 19:44:35 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-08-09 19:44:35 (GMT) |
commit | 9ab82b70828a5d2675f86eb6676f328084188f9f (patch) | |
tree | 68823bab626c47dd2efe43935ed5958a22289be6 /scripts/check.py | |
parent | 4b3d7eb57421ee1470bf2da23840c0e1d34a587c (diff) |
Make pylint a check type
Diffstat (limited to 'scripts/check.py')
-rw-r--r-- | scripts/check.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/check.py b/scripts/check.py index 4142d89..1f5eb72 100644 --- a/scripts/check.py +++ b/scripts/check.py @@ -19,7 +19,10 @@ class cmd_check(Command): Command.__init__(self, [ make_option('-x', '--xvfb-port', action='store', dest='xvfb_port', default=None, - help='specify the port of the xvfb server') + help='specify the port of the xvfb server'), + make_option('-t', '--type', action='store', + dest='type', default=None, + help='specify the check type') ]) def start_xvfb(self, port): @@ -41,7 +44,7 @@ class cmd_check(Command): return False def lint(self, module): - return self.run_pylint([module, '--rcfile=%s' % pylintrc_path]) + self.run_pylint([module, '--rcfile=%s' % pylintrc_path]) def lint_path(self, path): cwd = os.getcwd() @@ -54,23 +57,23 @@ class cmd_check(Command): python_files.append(os.path.join(path, f)) args = ['--rcfile=%s' % pylintrc_path] + python_files - result = self.run_pylint(args) + self.run_pylint(args) os.chdir(cwd) - return result + def check_pylint(self, config): + sugar_path = os.path.join(config.prefix, 'share', 'sugar') - def run(self, config, options, args): - results = [] + self.lint_path(os.path.join(sugar_path, 'shell')) + self.lint_path(os.path.join(sugar_path, 'service')) + self.lint('sugar') + def run(self, config, options, args): self.start_xvfb(options.xvfb_port) - sugar_path = os.path.join(config.prefix, 'share', 'sugar') - - results.append(self.lint_path(os.path.join(sugar_path, 'shell'))) - results.append(self.lint_path(os.path.join(sugar_path, 'service'))) - results.append(self.lint('sugar')) - - return False in results + if options.type == 'pylint': + self.check_pylint(config) + else: + return False register_command(cmd_check) |