Traling whitespace and pep8 cleaning

This commit is contained in:
Florent 2014-03-10 20:17:54 +01:00
commit 36cc82d34a
3 changed files with 4 additions and 9 deletions

View file

@ -17,9 +17,6 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>. # along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.capabilities.video import ICapVideo, BaseVideo from weboob.capabilities.video import ICapVideo, BaseVideo
from weboob.capabilities.collection import ICapCollection, CollectionNotFound from weboob.capabilities.collection import ICapCollection, CollectionNotFound
from weboob.tools.backend import BaseBackend from weboob.tools.backend import BaseBackend

View file

@ -96,7 +96,6 @@ class VideoPage(BasePage):
return video return video
def set_video_metadata(self, video): def set_video_metadata(self, video):
head = self.parser.select(self.document.getroot(), 'head', 1) head = self.parser.select(self.document.getroot(), 'head', 1)
@ -133,7 +132,6 @@ class VideoPage(BasePage):
except BrokenPageError: except BrokenPageError:
video.description = u'' video.description = u''
def set_video_url(self, video): def set_video_url(self, video):
embed_page = self.browser.readurl('http://www.dailymotion.com/embed/video/%s' % video.id) embed_page = self.browser.readurl('http://www.dailymotion.com/embed/video/%s' % video.id)
@ -143,10 +141,10 @@ class VideoPage(BasePage):
raise BrokenPageError('Unable to find information about video') raise BrokenPageError('Unable to find information about video')
info = json.loads(m.group(1)) info = json.loads(m.group(1))
for key in ['stream_h264_hd1080_url','stream_h264_hd_url', for key in ['stream_h264_hd1080_url', 'stream_h264_hd_url',
'stream_h264_hq_url','stream_h264_url', 'stream_h264_hq_url', 'stream_h264_url',
'stream_h264_ld_url']: 'stream_h264_ld_url']:
if info.get(key):#key in info and info[key]: if info.get(key):
max_quality = key max_quality = key
break break
else: else:

View file

@ -51,7 +51,7 @@ class DailymotionTest(BackendTest):
self.assertTrue(len(l) > 0) self.assertTrue(len(l) > 0)
for elt in l[:10]: for elt in l[:10]:
video_id = elt.id video_id = elt.id
video = self.backend.get_video(video_id) video = self.backend.get_video(video_id)
self.assertIsNotNone(video.title) self.assertIsNotNone(video.title)
if DailymotionTest.KIDS_VIDEO_TITLE in video.title: if DailymotionTest.KIDS_VIDEO_TITLE in video.title:
self.assertTrue(video.url and video.url.startswith('http://'), 'URL for video "%s" not found: %s' % self.assertTrue(video.url and video.url.startswith('http://'), 'URL for video "%s" not found: %s' %