From b1e1fc3a34cbdf1f646ad4929ec53818631d7385 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 15 Jul 2020 10:27:29 +0100 Subject: [PATCH] Restore 'EDMC -v' to announcing newer versions. I got too enthusiastic in 3ff77c3c54dea4bf36d957cd2dbd5b1b02dcb094 when I removed the "cut it down to A.BC" code. This restores the old output, but using a less confusing if/else. --- EDMC.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/EDMC.py b/EDMC.py index e0e3fd9c..5b5819aa 100755 --- a/EDMC.py +++ b/EDMC.py @@ -71,11 +71,14 @@ try: item.find('title').text) for item in feed.findall('channel/item')]) lastversion = sorted(items, key=versioncmp)[-1] if versioncmp(lastversion) > versioncmp(appversion): - latest = ' (%s is available)' % items[lastversion] + latest = items[lastversion] except Exception as e: sys.stderr.write('Exception in version check: {}'.format(str(e))) #pass # Quietly suppress timeouts etc. - print(appversion) + if latest: + print('{CURRENT} ({UPDATE} is available)'.format(CURRENT=appversion, UPDATE=latest)) + else: + print(appversion) sys.exit(EXIT_SUCCESS) if args.j: