From b037f777daeaaf95c8b8c85fc60ac5a463da4a0a Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 16 Oct 2013 21:53:46 -0700 Subject: [PATCH] echonest_tempo/#420: py26, line wrap, ... --- beetsplug/echonest_tempo.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/beetsplug/echonest_tempo.py b/beetsplug/echonest_tempo.py index 2810b30ba..01e5a40f0 100644 --- a/beetsplug/echonest_tempo.py +++ b/beetsplug/echonest_tempo.py @@ -102,12 +102,17 @@ def get_tempo(artist, title, duration): min_distance = duration pick = None for result in results: - if result.artist_name.lower() == artist and result.title.lower() == title: + if result.artist_name.lower() == artist and \ + result.title.lower() == title: distance = abs(duration - result.audio_summary['duration']) - log.debug(u'echonest_tempo: candidate {} - {} [abs({:2.2f}-{:2.2f})={:2.2f}] = {}'.format( - result.artist_name, result.title, - result.audio_summary['duration'], duration, distance, - result.audio_summary['tempo'])) + log.debug( + u'echonest_tempo: candidate {0:2.2f} ' + u'(distance: {1:2.2f}) = {2}'.format( + result.audio_summary['duration'], + distance, + result.audio_summary['tempo'], + ) + ) if distance < min_distance: min_distance = distance pick = result.audio_summary['tempo']