Add option to supress fancy output
This commit is contained in:
parent
bf828bbac5
commit
05e077105a
@ -55,6 +55,7 @@ if __name__ == '__main__':
|
||||
ap = ArgumentParser()
|
||||
ap.add_argument('images', type=str, nargs='+', help='')
|
||||
ap.add_argument('-d', '--delete', action='store_true', help='Delete all but the best quality image.')
|
||||
ap.add_argument('-q', '--quiet', action='store_true', help='Print quality measurements only.')
|
||||
return ap.parse_args()
|
||||
|
||||
|
||||
@ -63,6 +64,9 @@ if __name__ == '__main__':
|
||||
maximum = max(ratings, key=ratings.get)
|
||||
|
||||
for rating in ratings.keys():
|
||||
if args.quiet:
|
||||
print(ratings[rating])
|
||||
else:
|
||||
maxmark = '*' if rating == maximum and len(ratings) > 1 else ' '
|
||||
print('{}imgrate("{}") = {}'.format(maxmark, rating, ratings[rating]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user