From 4983ff09c0564010fc4ecf2d04b227f35311157a Mon Sep 17 00:00:00 2001 From: neingeist Date: Sun, 28 Jun 2015 04:28:03 +0200 Subject: [PATCH] have wiki-upload report on the warnings of the wiki --- wiki-upload | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wiki-upload b/wiki-upload index 0d35400..5b005e4 100755 --- a/wiki-upload +++ b/wiki-upload @@ -53,10 +53,14 @@ def main(): for image in args.images: destination_name = os.path.basename(image) - print('Uploading {} ... '.format(destination_name), end='') + print('Uploading {} ... '.format(destination_name)) ret = site.upload(open(image), destination_name, args.description) color = 'green' if ret['result'] == 'Success' else 'yellow' - print(termcolor.colored(ret['result'], color)) + print(termcolor.colored(' {}'.format(ret['result']), color)) + if 'warnings' in ret: + for warning, what in ret['warnings'].items(): + print(termcolor.colored(' {}: {}'.format(warning, what), + 'yellow')) main()