mirror of
https://github.com/NaN-tic/tryton-upgrades.git
synced 2023-12-14 03:32:55 +01:00
Discard duplicates on summary calculation.
This commit is contained in:
parent
c2e95dbbf6
commit
dfc65ff87d
1 changed files with 4 additions and 4 deletions
8
upgrade
8
upgrade
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue