[brightcove:new] flake8 for PEP 8

I really reget not being able to use this compact syntax, as well as to align
with spaces:
            if not account_id: account_id  = attrs.get('data-account')
            if not player_id:  player_id   = attrs.get('data-player')
            if not embed:      embed       = attrs.get('data-embed')
but it really upsets flake8:

brightcove.py:519:30: E701 multiple statements on one line (colon)
brightcove.py:519:42: E221 multiple spaces before operator
brightcove.py:520:29: E701 multiple statements on one line (colon)
brightcove.py:520:30: E241 multiple spaces after ':'
brightcove.py:520:41: E221 multiple spaces before operator
brightcove.py:521:25: E701 multiple statements on one line (colon)
brightcove.py:521:26: E241 multiple spaces after ':'
brightcove.py:521:37: E221 multiple spaces before operator
This commit is contained in:
John Hawkinson 2017-03-07 07:52:08 -05:00
parent 99474c6510
commit 63108b8835

View File

@ -487,7 +487,7 @@ class BrightcoveNewIE(InfoExtractor):
# 5. https://support.brightcove.com/en/video-cloud/docs/dynamically-assigning-videos-player # 5. https://support.brightcove.com/en/video-cloud/docs/dynamically-assigning-videos-player
# [1] looks like: # [1] looks like:
# <video data-video-id="5320421710001" data-account="245991542" data-player="SJWAiyYWg" data-embed="default" class="video-js" controls itemscope itemtype="http://schema.org/VideoObject"> # <video data-video-id="5320421710001" data-account="245991542" data-player="SJWAiyYWg" data-embed="default" class="video-js" controls itemscope itemtype="http://schema.org/VideoObject">
entries = [] entries = []
@ -498,28 +498,33 @@ class BrightcoveNewIE(InfoExtractor):
# Look for <video> tags [1] and embed_in_page embeds [2] # Look for <video> tags [1] and embed_in_page embeds [2]
for video, script_tag, account_id, player_id, embed in re.findall( for video, script_tag, account_id, player_id, embed in re.findall(
r'''(?isx) r'''(?isx)
(<video[^>]+>) (<video[^>]+>)
(?:.*? (?:.*?
(<script[^>]+ (<script[^>]+
src=["\'](?:https?:)?//players\.brightcove\.net/ src=["\'](?:https?:)?//players\.brightcove\.net/
(\d+)/([^/]+)_([^/]+)/index(?:\.min)?\.js (\d+)/([^/]+)_([^/]+)/index(?:\.min)?\.js
) )
)? )?
''', webpage): ''', webpage
):
attrs = extract_attributes(video) attrs = extract_attributes(video)
# According to examples from [4] it's unclear whether video id # According to examples from [4] it's unclear whether video id
# may be optional and what to do when it is # may be optional and what to do when it is
video_id = attrs.get('data-video-id') video_id = attrs.get('data-video-id')
# See PR#12099/bostonglobe.py for 'data-brightcove-video-id' variant # See PR#12099/bostonglobe.py for 'data-brightcove-video-id' variant
if not account_id: account_id = attrs.get('data-account') if not account_id:
if not player_id: player_id = attrs.get('data-player') account_id = attrs.get('data-account')
if not embed: embed = attrs.get('data-embed') if not player_id:
player_id = attrs.get('data-player')
if not embed:
embed = attrs.get('data-embed')
# According to [5] data-video-id may be prefixed with 'ref:' # According to [5] data-video-id may be prefixed with 'ref:'
if video_id: video_id = video_id.rpartition('ref:')[2] if video_id:
video_id = video_id.rpartition('ref:')[2]
if video_id and account_id and player_id and embed: if video_id and account_id and player_id and embed:
entries.append( entries.append(