pep8 fixes

This commit is contained in:
Tomas Groth 2015-10-19 23:32:26 +01:00
parent 7470205185
commit b4669e0bf6

View File

@ -28,7 +28,7 @@ from http.cookiejar import CookieJar
from urllib.parse import urlencode
from urllib.request import HTTPCookieProcessor, URLError, build_opener
from html.parser import HTMLParser
if sys.version_info > (3,4):
if sys.version_info > (3, 4):
from html import unescape
@ -132,7 +132,7 @@ class SongSelectImport(object):
if not search_results:
break
for result in search_results:
if sys.version_info > (3,4):
if sys.version_info > (3, 4):
song = {
'title': unescape(result.find('h3').string),
'authors': [unescape(author.string) for author in result.find_all('li')],
@ -177,7 +177,7 @@ class SongSelectImport(object):
if callback:
callback()
song['copyright'] = '/'.join([li.string for li in song_page.find('ul', 'copyright').find_all('li')])
if sys.version_info > (3,4):
if sys.version_info > (3, 4):
song['copyright'] = unescape(song['copyright'])
else:
song['copyright'] = self.html_parser.unescape(song['copyright'])
@ -193,12 +193,12 @@ class SongSelectImport(object):
else:
verse['lyrics'] += '\n'
verse['lyrics'] = verse['lyrics'].strip(' \n\r\t')
if sys.version_info > (3,4):
if sys.version_info > (3, 4):
song['verses'].append(unescape(verse))
else:
song['verses'].append(self.html_parser.unescape(verse))
for counter, author in enumerate(song['authors']):
if sys.version_info > (3,4):
if sys.version_info > (3, 4):
song['authors'][counter] = unescape(author)
else:
song['authors'][counter] = self.html_parser.unescape(author)