From 3bf79c752ede4503db2b6cd5e8ccb55d163f6598 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Fri, 22 Feb 2013 00:36:23 +0100 Subject: [PATCH] Print *all* release notes --- youtube_dl/update.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/youtube_dl/update.py b/youtube_dl/update.py index f6e3e5c69..8e5326196 100644 --- a/youtube_dl/update.py +++ b/youtube_dl/update.py @@ -77,10 +77,8 @@ def update_self(to_screen, verbose, filename): to_screen(u'Updating to version ' + versions_info['latest'] + '...') version = versions_info['versions'][versions_info['latest']] - if version.get('notes'): - to_screen(u'PLEASE NOTE:') - for note in version['notes']: - to_screen(note) + + print_notes(version_info['versions']) if not os.access(filename, os.W_OK): to_screen(u'ERROR: no write permissions on %s' % filename) @@ -158,3 +156,13 @@ del "%s" return to_screen(u'Updated youtube-dl. Restart youtube-dl to use the new version.') + +def print_notes(versions, fromVersion=__version__): + notes = [] + for v,vdata in sorted(versions.items()): + if v > fromVersion: + notes.extend(vdata.get('notes', [])) + if notes: + to_screen(u'PLEASE NOTE:') + for note in notes: + to_screen(note)