
Untitled
By: a guest on
Jul 10th, 2012 | syntax:
None | size: 0.72 KB | hits: 9 | expires: Never
import environment
import subprocess
class Lint:
def __init__(self, source_file):
self.args = [ 'lint-nt.exe', '-w2', source_file ]
self.errors_found = 0
def execute(self):
process = subprocess.Popen(self.args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
process.poll()
self.errors_found = process.returncode
def containsErrors(self):
return self.errors_found
for file in environment.files():
if Lint(file).execute().containsErrors():
environment.failed('LINT')
else:
environment.passed('LINT')