Discard duplicates on summary calculation.

This commit is contained in:
Albert Cervera i Areny 2017-01-21 00:48:30 +01:00
parent c2e95dbbf6
commit dfc65ff87d

View file

@ -20,7 +20,7 @@ def get_url():
def run(*args):
print 'RUNING:', ' '.join(args)
summary = []
summary = set()
process = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, bufsize=1)
#for line in iter(process.stdout.readline, b''):
@ -28,16 +28,16 @@ def run(*args):
line = line.strip()
if 'ERROR' in line:
line = t.red(line)
summary.append(line)
summary.add(line)
elif 'WARNING' in line:
line = t.yellow(line)
summary.append(line)
summary.add(line)
print line
process.stdout.close()
process.wait()
if summary:
print t.bold('\nWARNING AND ERROR SUMMARY:')
print '\n'.join(summary)
print '\n'.join(sorted(list(summary)))
return process.returncode
def execute(query, *args, **kwargs):