From 46a127eecbd3aac52b063ff11813cc7994160e27 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 28 Apr 2013 16:19:37 +0200 Subject: [PATCH] Fix print_notes --- youtube_dl/update.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/youtube_dl/update.py b/youtube_dl/update.py index d6e293875..eab8417a5 100644 --- a/youtube_dl/update.py +++ b/youtube_dl/update.py @@ -78,7 +78,7 @@ def update_self(to_screen, verbose, filename): to_screen(u'Updating to version ' + versions_info['latest'] + '...') version = versions_info['versions'][versions_info['latest']] - print_notes(versions_info['versions']) + print_notes(to_screen, versions_info['versions']) if not os.access(filename, os.W_OK): to_screen(u'ERROR: no write permissions on %s' % filename) @@ -157,11 +157,15 @@ def update_self(to_screen, verbose, filename): to_screen(u'Updated youtube-dl. Restart youtube-dl to use the new version.') -def print_notes(versions, fromVersion=__version__): +def get_notes(versions, fromVersion): notes = [] for v,vdata in sorted(versions.items()): if v > fromVersion: notes.extend(vdata.get('notes', [])) + return notes + +def print_notes(to_screen, versions, fromVersion=__version__): + notes = get_notes(versions, fromVersion) if notes: to_screen(u'PLEASE NOTE:') for note in notes: