pep8 fixes, modernizations

autopep8 -a -r -i --select E711,E712,W601,W602,W603,W604,W690,E304,E401,E502 .
Also includes some manual reindentations (many are left after the print()
changes).
Manually checked, some modernizations not commited here.
This commit is contained in:
Laurent Bachelier 2014-10-10 22:10:41 +02:00
commit 6161a0aacd
18 changed files with 57 additions and 51 deletions

View file

@ -142,7 +142,7 @@ class RoadmapPage(Page):
if len(current_step['line']) > 0 and \
len(current_step['departure']) > 0 and \
len(current_step['arrival']) > 0:
current_step['line'] = to_unicode("%s : %s" % \
current_step['line'] = to_unicode("%s : %s" %
(current_step['mode'], current_step['line']))
del current_step['mode']
yield current_step

View file

@ -26,7 +26,8 @@ from weboob.tools.backend import Module, BackendConfig
from .browser import NolifeTVBrowser
from .video import NolifeTVVideo
import urllib, time
import urllib
import time
from hashlib import md5
__all__ = ['NolifeTVModule']

View file

@ -69,7 +69,7 @@ class VideoPage(Page):
class VideoListPage(Page):
def is_list_empty(self):
return self.document.getroot() == None
return self.document.getroot() is None
def iter_video(self, available_videos):
for el in self.document.getroot().xpath('//li/a'):
@ -101,7 +101,7 @@ class FamilyPage(Page):
while True:
el = el.getnext()
if el == None or el.get('data-role'):
if el is None or el.get('data-role'):
break
h1 = el.find('.//h1')
id = h1.getparent().attrib['href']

View file

@ -40,4 +40,4 @@ class TvsubtitlesTest(BackendTest):
subtitles = list(self.backend.iter_subtitles('fr', 'sopranos'))
assert (len(subtitles) > 0)
subtitle = choice(subtitles)
assert self.backend.get_subtitle(subtitle.id)
assert self.backend.get_subtitle(subtitle.id)