[rhythmbox] lyrics: remove whitespace from artist/title strings (bug #644045)
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] lyrics: remove whitespace from artist/title strings (bug #644045)
- Date: Sun, 5 Feb 2012 05:02:02 +0000 (UTC)
commit 3aa5da74b7b606ba22b469d36054eb9732ca8936
Author: Hardy Beltran Monasterios <hbm hardy com bo>
Date: Sun Feb 5 15:00:38 2012 +1000
lyrics: remove whitespace from artist/title strings (bug #644045)
plugins/lyrics/TerraParser.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/lyrics/TerraParser.py b/plugins/lyrics/TerraParser.py
index ccbee92..657fb8e 100644
--- a/plugins/lyrics/TerraParser.py
+++ b/plugins/lyrics/TerraParser.py
@@ -100,11 +100,13 @@ class TerraParser (object):
source = re.split('<p>', source)
# Parse artist and title
artistitle = re.sub('<.*?>', '', source[0])
+ rx = re.compile('^(\t|\n)+',re.M | re.S)
+ artistitle = rx.sub('', artistitle)
# Parse lyrics
lyrics = re.split('</p>', source[1])[0]
lyrics = re.sub('<[Bb][Rr]/>', '', lyrics)
- lyrics = unescape_entities(artistitle) + unescape_entities(lyrics)
+ lyrics = unescape_entities(artistitle) + "\n" + unescape_entities(lyrics)
lyrics += "\n\nEsta letra foi disponibilizada pelo site\nhttp://letras.terra.com.br"
return lyrics
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]