def bumperize(video):
 video.bumper = {'enabled': False, 'edx_video_id': '', 'transcripts': {}, 'metadata': None}
 if (not is_bumper_enabled(video)):
  return
 bumper_settings = get_bumper_settings(video)
 try:
  video.bumper['edx_video_id'] = bumper_settings['video_id']
  video.bumper['transcripts'] = bumper_settings['transcripts']
 except (TypeError, KeyError):
  log.warning('Could not retrieve video bumper information from course settings')
  return
 sources = get_bumper_sources(video)
 if (not sources):
  return
 video.bumper.update({'metadata': bumper_metadata(video, sources), 'enabled': True})

def bumperize ( video ) : video . bumper = { 'enabled' : False , 'edx_video_id' : '' , 'transcripts' : { } , 'metadata' : None } if ( not is_bumper_enabled ( video ) ) : return bumper_settings = get_bumper_settings ( video ) try : video . bumper [ 'edx_video_id' ] = bumper_settings [ 'video_id' ] video . bumper [ 'transcripts' ] = bumper_settings [ 'transcripts' ] except ( TypeError , KeyError ) : log . warning ( 'Could not retrieve video bumper information from course settings' ) return sources = get_bumper_sources ( video ) if ( not sources ) : return video . bumper . update ( { 'metadata' : bumper_metadata ( video , sources ) , 'enabled' : True } )
populate video with bumper settings .